(window.webpackJsonp = window.webpackJsonp || []).push([
  [1005],
  {
    1194: function (e, t, i) {
      "use strict";
      i.r(t),
        i.d(t, "HIT_RESULT_TYPES", function () {
          return n;
        });
      var n = {
        DEFAULT: "DEFAULT",
        SCROLLBAR: "SCROLLBAR",
        SELECTION: "SELECTION",
        TEXT: "TEXT",
        TEXT_FOOTENDNOTE_PLACEHOLDER: "TEXT_FOOTENDNOTE_PLACEHOLDER",
        COOPER_SELECTION: "COOPER_SELECTION",
        COOPER_SELECTION_SHAPE: "COOPER_SELECTION_SHAPE",
        PAGE_MARGIN_LEFT: "PAGE_MARGIN_LEFT",
        TASK_LIST: "TASK_LIST",
        NUM_LIST: "NUM_LIST",
        TABLE_TEXT: "TABLE_TEXT",
        TABLE_CELL_SELECT: "TABLE_CELL_SELECT",
        TABLE_ROW_SELECT: "TABLE_ROW_SELECT",
        TABLE_COLUMN_SELECT: "TABLE_COLUMN_SELECT",
        TABLE_ROW_RESIZE: "TABLE_ROW_RESIZE",
        TABLE_COLUMN_RESIZE: "TABLE_COLUMN_RESIZE",
        TABLE_HYPERLINK: "TABLE_HYPERLINK",
        SHAPE: "SHAPE",
        CONTROL: "CONTROL",
        SEPARATOR_LINE: "SEPARATOR_LINE",
        SHAPE_RESIZE_TL: "SHAPE_RESIZE_TL",
        SHAPE_RESIZE_TM: "SHAPE_RESIZE_TM",
        SHAPE_RESIZE_TR: "SHAPE_RESIZE_TR",
        SHAPE_RESIZE_RM: "SHAPE_RESIZE_RM",
        SHAPE_RESIZE_BR: "SHAPE_RESIZE_BR",
        SHAPE_RESIZE_BM: "SHAPE_RESIZE_BM",
        SHAPE_RESIZE_BL: "SHAPE_RESIZE_BL",
        SHAPE_RESIZE_LM: "SHAPE_RESIZE_LM",
        SHAPE_CLIP_TL: "SHAPE_CLIP_TL",
        SHAPE_CLIP_TM: "SHAPE_CLIP_TM",
        SHAPE_CLIP_TR: "SHAPE_CLIP_TR",
        SHAPE_CLIP_RM: "SHAPE_CLIP_RM",
        SHAPE_CLIP_BR: "SHAPE_CLIP_BR",
        SHAPE_CLIP_BM: "SHAPE_CLIP_BM",
        SHAPE_CLIP_BL: "SHAPE_CLIP_BL",
        SHAPE_CLIP_LM: "SHAPE_CLIP_LM",
        SHAPE_CLIP_SOURCE_TL: "SHAPE_CLIP_SOURCE_TL",
        SHAPE_CLIP_SOURCE_TM: "SHAPE_CLIP_SOURCE_TM",
        SHAPE_CLIP_SOURCE_TR: "SHAPE_CLIP_SOURCE_TR",
        SHAPE_CLIP_SOURCE_RM: "SHAPE_CLIP_SOURCE_RM",
        SHAPE_CLIP_SOURCE_BR: "SHAPE_CLIP_SOURCE_BR",
        SHAPE_CLIP_SOURCE_BM: "SHAPE_CLIP_SOURCE_BM",
        SHAPE_CLIP_SOURCE_BL: "SHAPE_CLIP_SOURCE_BL",
        SHAPE_CLIP_SOURCE_LM: "SHAPE_CLIP_SOURCE_LM",
        SHAPE_ADJUSTHANDLER_1: "SHAPE_ADJUSTHANDLER_1",
        SHAPE_ADJUSTHANDLER_2: "SHAPE_ADJUSTHANDLER_2",
        SHAPE_ADJUSTHANDLER_3: "SHAPE_ADJUSTHANDLER_3",
        SHAPE_ADJUSTHANDLER_4: "SHAPE_ADJUSTHANDLER_4",
        SHAPE_ADJUSTHANDLER_5: "SHAPE_ADJUSTHANDLER_5",
        SHAPE_ADJUSTHANDLER_6: "SHAPE_ADJUSTHANDLER_6",
        SHAPE_ADJUSTHANDLER_7: "SHAPE_ADJUSTHANDLER_7",
        SHAPE_ADJUSTHANDLER_8: "SHAPE_ADJUSTHANDLER_8",
        SHAPE_ADJUSTHANDLER_9: "SHAPE_ADJUSTHANDLER_9",
        HYPERLINK: "HYPERLINK",
        TEXTFRAME: "TEXTFRAME",
        TEXTBOX_PAGE: "TEXTBOX_PAGE",
        TEXTBOX_PADDING: "TEXTBOX_PADDING",
        TICKCHAR: "TICKCHAR",
        TICKCHAR_TICK: "TICKCHAR_TICK",
        TICKCHAR_UNTICK: "TICKCHAR_UNTICK",
      };
    },
    12737: function (e, t, i) {
      "use strict";
      i.r(t);
      var n = i(62),
        o = i.n(n),
        a = i(12),
        s = i.n(a),
        r = i(16),
        l = i.n(r),
        c = i(1),
        d = i.n(c),
        h = i(2),
        p = i.n(h),
        u = i(3770),
        f = i(290),
        g = i(509),
        v = i(298),
        y = g.DOCUnicodeSubRangeTools.DOCCharTypeFastDetecter,
        _ = (function () {
          function e() {
            d()(this, e);
          }
          return (
            p()(e, null, [
              {
                key: "moveToPosition",
                value: function (e, t) {
                  return t;
                },
              },
              {
                key: "moveNextPosition",
                value: function (t, i) {
                  var n =
                      arguments.length > 2 &&
                      void 0 !== arguments[2] &&
                      arguments[2],
                    o = i.position,
                    a = e.getLimitedRange(t, i.position);
                  if (!a) return null;
                  if (!n) {
                    var s = t.doc.getDataLogic("final").getPapx(o);
                    if (s && s.prop && s.prop.bidi)
                      return e.movePreviousPosition(t, i, !0);
                  }
                  var r = t.glyphpool,
                    l = a.pos + a.len,
                    c = !1,
                    d = !1,
                    h = void 0;
                  if (o < l) {
                    if ((h = r.getGlyphIterator(o)).charCode === f.FieldBegin) {
                      var p = t.doc.fields.getField(o);
                      if ("EQ" == p.type && o >= p.begin && o < p.end)
                        return (o = p.end), h.free(), o;
                    }
                    d = !h.isVisible();
                  }
                  for (; o + 1 < l; ) {
                    var u = r.glyphBuff.getEmojiCombineCharForward(o);
                    o++, h ? h.next() : (h = r.getGlyphIterator(o));
                    var v = r.glyphBuff.getCharCode(o),
                      _ = y.getUnicodeCharItem(v),
                      P = !1;
                    if (
                      (_.usrType == g.DOCTxUsrType.usrLowSurrogates && (P = !0),
                      !h)
                    )
                      break;
                    if (r.glyphBuff.getCharCode(o) === f.FieldBegin) {
                      var T = t.doc.fields.getField(o);
                      if ("TOC" !== T.type) return h.free(), o;
                    } else {
                      if (h.isVisible()) {
                        if (h.isSeparator()) break;
                        if (P) continue;
                        return u ? (o += u) : (h.free(), o + (d && c ? 1 : 0));
                      }
                      var E = r.glyphBuff.getCharCode(o);
                      if (
                        E === f.ControlBegin ||
                        E === f.ControlEnd ||
                        E === f.MathFunction ||
                        E === f.MathArgEnd
                      )
                        return h.free(), o + (d && c ? 1 : 0);
                      c = !0;
                    }
                  }
                  return h && h.free(), l - 1;
                },
              },
              {
                key: "movePreviousPosition",
                value: function (t, i) {
                  var n =
                      arguments.length > 2 &&
                      void 0 !== arguments[2] &&
                      arguments[2],
                    o = i.position,
                    a = e.getLimitedRange(t, i.position);
                  if (!a) return null;
                  if (!n) {
                    var s = t.doc.getDataLogic("final").getPapx(o);
                    if (s && s.prop && s.prop.bidi)
                      return e.moveNextPosition(t, i, !0);
                  }
                  for (
                    var r = a.pos, l = t.glyphpool, c = void 0;
                    o - 1 >= r;

                  ) {
                    o--;
                    var d = l.glyphBuff.getEmojiCombineCharBackward(o);
                    c ? c.prev() : (c = l.getGlyphIterator(o));
                    var h = l.glyphBuff.getCharCode(o),
                      p = y.getUnicodeCharItem(h),
                      u = !1;
                    if (
                      (p.usrType == g.DOCTxUsrType.usrLowSurrogates && (u = !0),
                      !c)
                    )
                      break;
                    if (c.isVisible()) {
                      if (u) continue;
                      return d ? (o -= d) : (c.free(), o);
                    }
                    var v = l.glyphBuff.getCharCode(o);
                    if (
                      v === f.ControlBegin ||
                      v === f.ControlEnd ||
                      v === f.MathFunction ||
                      v === f.MathArgEnd
                    )
                      return c.free(), o;
                  }
                  return c && c.free(), a.pos;
                },
              },
              {
                key: "moveUpPosition",
                value: function (t, i) {
                  var n = i.pos;
                  if (!n) return null;
                  var o = { x: n.posX, y: n.posY },
                    a = e.getSelContext(t, i),
                    s = a.limitedRange,
                    r = a.currentLayoutIndex,
                    l = a.subdocType,
                    c = { limitInSubdocType: l };
                  [v.MainText, v.Footnote, v.Endnote].includes(l) &&
                    (c.canHitNotes = !0),
                    t.selection.selContext.isInComment() &&
                      (c.commentId = t.selection.selContext.getCommentRcId());
                  for (var d = 2e3; d && o.y >= 0; ) {
                    o.y -= 8;
                    var h = { x: o.x, y: o.y },
                      p = u.a.hit(t, h, t.typoinfo, c);
                    if (
                      p &&
                      !p.isFuzzyHitOnLine &&
                      (!s ||
                        (p.position >= s.pos && p.position < s.pos + s.len)) &&
                      Math.ceil(p.posY) < n.posY &&
                      p.line &&
                      !p.line.host.isRepeatHeaderRow
                    ) {
                      if (null !== r && r !== p.layoutIndex) break;
                      return p;
                    }
                    d--;
                  }
                  return null;
                },
              },
              {
                key: "moveDownPosition",
                value: function (t, i) {
                  var n = i.pos;
                  if (!n) return null;
                  var o = n.drawHeight || n.height,
                    a = { x: n.posX, y: n.posY + o },
                    s = e.getSelContext(t, i),
                    r = s.limitedRange,
                    l = s.currentLayoutIndex,
                    c = s.subdocType,
                    d = { limitInSubdocType: c };
                  [v.MainText, v.Footnote, v.Endnote].includes(c) &&
                    (d.canHitNotes = !0),
                    t.selection.selContext.isInComment() &&
                      (d.commentId = t.selection.selContext.getCommentRcId());
                  for (
                    var h = 2e3,
                      p = t.typoinfo.allpage_height || t.typoinfo.height,
                      f = o < 8 && o > 0 ? o : 8;
                    h && a.y <= p;

                  ) {
                    a.y += f;
                    var g = { x: a.x, y: a.y },
                      y = u.a.hit(t, g, t.typoinfo, d);
                    if (
                      y &&
                      !y.isFuzzyHitOnLine &&
                      (!r ||
                        (y.position >= r.pos && y.position < r.pos + r.len)) &&
                      Math.floor(y.posY) > n.posY &&
                      y.line &&
                      !y.line.host.isRepeatHeaderRow
                    ) {
                      if (null !== l && l !== y.layoutIndex) break;
                      return y;
                    }
                    h--;
                  }
                  return null;
                },
              },
              {
                key: "getLimitedRange",
                value: function (e, t) {
                  var i = e.selection.selContext.subdocType;
                  return i === v.Footnote || i === v.Endnote
                    ? e.doc.getSubDocRange(i)
                    : e.doc.getLimitedRange(t);
                },
              },
              {
                key: "getSelContext",
                value: function (e, t) {
                  var i = void 0,
                    n = null;
                  return (
                    e.selection.selContext.isInTextbox &&
                      ((i = e.doc.getLimitedRange(t.position)),
                      (n = e.selection.selContext.isInHeaderFooter
                        ? e.selection.selContext.headerfooterLayoutIndex
                        : null)),
                    {
                      subdocType: e.selection.selContext.subdocType,
                      limitedRange: i,
                      currentLayoutIndex: n,
                    }
                  );
                },
              },
            ]),
            e
          );
        })(),
        P = i(1791),
        T = i(1338),
        E = i(1413),
        S = i(1476),
        x = i(1196),
        b = i(371),
        C = i(1666),
        L = i(260),
        m = i(787),
        I = i(28),
        R = i(3586),
        w = /[\u0e00-\u0e7f]/;
      function A(e, t) {
        return (
          t.findIndex(function (t) {
            if (e.length !== t.length) return !1;
            for (var i = 0, n = t.length; i < n; ++i)
              if (t[i] !== e[i]) return !1;
            return !0;
          }) >= 0
        );
      }
      var H = (function () {
        function e(t) {
          d()(this, e),
            (this.selection = t),
            (this.data = this.selection.data),
            (this.cachedSelectionInfo = {});
        }
        return (
          p()(e, [
            {
              key: "selectionBlock",
              value: function (e) {
                var t =
                    arguments.length > 1 && void 0 !== arguments[1]
                      ? arguments[1]
                      : {},
                  i = l()({ isSend: !0, isClick: !0 }, t);
                if (e) {
                  var n = new P.a(this.selection, e),
                    o = n.pos;
                  if (o) {
                    var a = void 0;
                    if (!o.glyphTail) {
                      a = _.moveNextPosition(this.data, n);
                      var s = o.position,
                        r = a;
                      if (null !== a)
                        return (
                          o.lineBreakHit && (r = s + 1),
                          this.selection.setPosition(s, r, i),
                          void this.selection.clearActiveCtrls()
                        );
                    }
                    if (!(a = _.movePreviousPosition(this.data, n)))
                      return null;
                    this.selectionBlock(a, i);
                  }
                }
              },
            },
            {
              key: "patchForEngLexerBlank",
              value: function (e, t) {
                var i = e.begin,
                  n = e.end,
                  o = n - i,
                  a = n,
                  s = this.data.doc
                    .getDataLogic("final")
                    .specHidden.getText(i, o).text;
                if (/^[_A-Za-z0-9]+$/.test(s)) {
                  var r = this.data.doc
                    .getDataLogic("final")
                    .specHidden.getSpaceAfterPos(n, 4, { pos: n, len: t - n });
                  null != r && (a = r);
                }
                return a;
              },
            },
            {
              key: "extendSelectBlock",
              value: function (e, t) {
                var i = this,
                  n =
                    arguments.length > 2 && void 0 !== arguments[2]
                      ? arguments[2]
                      : {},
                  o = l()({ isSend: !0 }, n),
                  a = this.data.doc
                    .getDataLogic("final")
                    .specHidden.getSentenceByPunctuation(e);
                if (!a || !a.fragment)
                  return this.selectionBlock(e, o), t && t(!1), !1;
                var s = a.limit,
                  r = a.fragment.range,
                  c = r.begin,
                  d = r.end,
                  h = a.fragment.text,
                  p = e.position,
                  u = this.data.doc.getText(p, 1),
                  f =
                    w.test(u) ||
                    ("." === u &&
                      p > 0 &&
                      w.test(this.data.doc.getText(p - 1, 1))),
                  g = /^[_A-Za-z0-9]+$/,
                  v = f || g.test(h),
                  y = function (e) {
                    var n = a.index,
                      r = a.fragment,
                      l =
                        e &&
                        i.data.doc
                          .getDataLogic("final")
                          .specHidden.getCutRangeForIndex(e, n, r);
                    if (l) {
                      var h = l.begin,
                        p = i.patchForEngLexerBlank(l, s);
                      i.selection.setPosition(h, p, o);
                    } else {
                      var u = i.patchForEngLexerBlank({ begin: c, end: d }, s);
                      i.selection.setPosition(c, u, o);
                    }
                    t && t(!0);
                  };
                if (window.Jieba && window.InitJiebaCompleted && !v)
                  window.Jieba.cut(h, y);
                else {
                  var _ =
                    f && window.APP.thaiDict && window.APP.thaiDict.cut(h);
                  y(_);
                }
                return !0;
              },
            },
            {
              key: "_getAdaptedShape",
              value: function (e) {
                var t = {
                  id: e.id,
                  gcp: void 0,
                  anchor: e.anchor && { shapeData: e.anchor.shapeData },
                  isExclusive: e.isExclusive,
                  wrap_mode: e.wrap_mode,
                  is_behind_text: e.is_behind_text,
                  vert_rel: e.vert_rel,
                  shape_tree_type: e.shape_tree_type,
                  viewRect: e.viewRect,
                  layoutViewRect: e.layoutViewRect,
                  size: e.size,
                  rect: e.rect,
                  viewPage: e.viewPage && {
                    layout_index: e.viewPage.layout_index,
                    rect: e.viewPage.rect,
                    outer_rect: e.viewPage.outer_rect,
                  },
                  adjustHandles: e.adjustHandles,
                  drawingLayout: e.drawingLayout,
                  shapeData: e.shapeData,
                  isChildShape: e.isChildShape,
                  isGroup: e.isGroup,
                  rotation: e.rotation,
                  horizontalFlipped: e.horizontalFlipped,
                  verticalFlipped: e.verticalFlipped,
                  visualTransform2D: e.visualTransform2D,
                  innerBoundary: e.innerBoundary,
                  hasEnterTextbox: e.hasEnterTextbox(),
                  isWebshape: e.isWebshape,
                  mediaData: e.mediaData,
                };
                switch (!0) {
                  case void 0 !== e.gcp:
                    t.gcp = e.gcp;
                    break;
                  case void 0 !== e.pos:
                    t.gcp = e.pos;
                    break;
                  case void 0 !== e.begin:
                    t.gcp = e.begin;
                }
                return (
                  t.isChildShape &&
                    (t.topShape = this._getAdaptedShape(e.topShape)),
                  t.visualTransform2D &&
                    0 !== t.visualTransform2D.rotation &&
                    e.shapeData.private.isRotateText &&
                    t.hasEnterTextbox &&
                    (t.doNotRotate = !0),
                  t
                );
              },
            },
            {
              key: "getAdaptedActiveShape",
              value: function () {
                var e = this.selection.activeShape;
                return e ? this._getAdaptedShape(e) : null;
              },
            },
            {
              key: "getAdaptedSelShapes",
              value: function () {
                var e = this,
                  t = this.selection.selShapes;
                if (t)
                  return t.map(function (t) {
                    return e._getAdaptedShape(t);
                  });
              },
            },
            {
              key: "checkIsInTextFormField",
              value: function (e) {
                var t = window.APP.data.fieldManager,
                  i = t.getField(e);
                return (
                  null == i && (i = t.getField(e - 1)),
                  !(!i || "FORMTEXT" !== i.type)
                );
              },
            },
            {
              key: "selectShape",
              value: function (e) {
                var t =
                  arguments.length > 1 && void 0 !== arguments[1]
                    ? arguments[1]
                    : {};
                if (
                  (window.APP.isEditMode ||
                    (e && e.shape && e.shape.isWebshape) ||
                    I.isMobile) &&
                  e &&
                  (e.shape || e.id) &&
                  "number" == typeof e.gcp &&
                  !(e.gcp < 0)
                ) {
                  this.selection.selContext.isInHeaderFooter &&
                    t.hasOwnProperty("layoutIndex") &&
                    this.selection.selContext.setHeaderfooterLayoutIndex(
                      t.layoutIndex
                    );
                  var i = e.id,
                    n = e.gcp,
                    o = e.shapeTreeType,
                    a = e.shapeIdxPath;
                  if (!a) {
                    var s =
                      this.data.doc.anchors.findAnchor(n) ||
                      this.data.doc.inlineAnchors.findAnchor(n);
                    (o = s.shapeData.shapeTreeType),
                      (a = [
                        this.data.doc.layer.getShapeTree(o).getShapeIndex(i),
                      ]).some(function (e) {
                        return e < 0;
                      }) && console.error("No correct shapeIdxPath", a);
                  }
                  var r = {
                    isSend: !0,
                    shapeIdxPath: a,
                    shapeTreeType: o,
                    shouldBlur: t && t.shouldBlur,
                    preventScroll: t && t.preventScroll,
                    preventFocus: t && t.preventFocus,
                    isClick: !0,
                  };
                  if ((t.isSelShapes || t.selShapeIdxPaths) && !e.isEmbedding) {
                    var l = this.selection.selShapes,
                      c = l && l[0],
                      d =
                        c &&
                        (c.isEmbedShape ||
                          (c.isChildShape && c.topShape.isEmbedShape));
                    if (!d) {
                      var h = this.selection.selShapeIdxPaths || [],
                        p = this.selection.activeShapeIdxPath;
                      void 0 === p || A(p, h) || h.push(p),
                        A(a, h) || h.push(a),
                        t.selShapeIdxPaths &&
                          t.selShapeIdxPaths.forEach(function (e) {
                            A(e, h) || h.push(e);
                          });
                      var u = [],
                        f = 0,
                        g = 0;
                      if (
                        (h.forEach(function (e) {
                          (f = Math.max(e.length, f)),
                            u.includes(e[0]) || u.push(e[0]),
                            1 === e.length && ++g;
                        }),
                        u.length > 1)
                      )
                        f > 1 &&
                          (h = u.map(function (e) {
                            return [e];
                          }));
                      else if (g > 0 && f > 1)
                        for (var v = h.length - 1; v >= 0; --v)
                          1 === h[v].length && h.splice(v, 1);
                      (r.selShapeIdxPaths = h.length > 1 && h),
                        h.some(function (e) {
                          return e.some(function (e) {
                            return e < 0;
                          });
                        }) &&
                          console.error("No correct selShapeIdxPaths", h, t);
                    }
                  }
                  this.selection.setPosition(n, n + 1, r);
                  var y = this.selection.activeShape;
                  y ||
                    this.data.typoinfo.updater.updateToPosInContext(
                      this.data,
                      e.gcp + 1
                    ),
                    !(y = this.selection.activeShape) ||
                      (window.APP.isWebMode() && !y.isEmbedShape) ||
                      L.default.dispatchEvent(
                        L.default.shape.ON_SHAPE_SELECTED,
                        { shapes: this.getAdaptedSelShapes() }
                      ),
                    y &&
                      y.isWebshape &&
                      L.default.dispatchEvent(
                        L.default.webshape.ON_WEBSHAPE_CARD_SWITCH,
                        { visible: !0, webshape: y }
                      );
                }
              },
            },
            {
              key: "selectParagraph",
              value: function (e) {
                var t =
                  arguments.length > 1 && void 0 !== arguments[1]
                    ? arguments[1]
                    : {};
                if (e < 0) return !1;
                var i = void 0,
                  n = void 0,
                  o = this.data.doc.getDataLogic("final").getPapx(e);
                return (
                  o.good && ((i = o.pos), (n = o.pos + o.len)),
                  !isNaN(i) &&
                    !isNaN(n) &&
                    (this.selection.setPosition(
                      i,
                      n,
                      l()({ preventScroll: !0 }, t)
                    ),
                    this.selection.clearActiveCtrls(),
                    !0)
                );
              },
            },
            {
              key: "selectTable",
              value: function () {
                var e =
                    arguments.length > 0 && void 0 !== arguments[0]
                      ? arguments[0]
                      : void 0,
                  t =
                    arguments.length > 1 &&
                    void 0 !== arguments[1] &&
                    arguments[1],
                  i =
                    arguments.length > 2 && void 0 !== arguments[2]
                      ? arguments[2]
                      : {},
                  n = e;
                if (void 0 === n) {
                  var o = this.selection.getActiveAreaNormalRanges();
                  n = o[0].pos;
                }
                var a = this.selection.getTableRange(n, t);
                a &&
                  this.selection.setPosition(
                    a.begin,
                    a.end,
                    l()({}, i, {
                      preventScroll: !0,
                      isSend: !0,
                      applyFormat: !0,
                      isClick: !0,
                    })
                  );
              },
            },
            {
              key: "selectAll",
              value: function () {
                var e = this.selection.selInfo.getSelectionInfo(),
                  t = e.end,
                  i = e.inTable,
                  n = this.formatContentController.getOuterMostControl(t),
                  o = this.selection.selContext.isInComment(),
                  a = this.selection.selContext.getCommentRcId(),
                  s = n && window.__CONFIG__.wps.enableContentControlSelectAll;
                if (
                  !this.formatContentController.isRestrictEditMode ||
                  this.checkIsInTextFormField(t) ||
                  s
                ) {
                  var r = !!n;
                  if (i && n) {
                    var l = Object(E.collectTable)(
                      this.data.doc,
                      this.selection.end.position
                    );
                    if (l) {
                      var c = l.range,
                        d = c.begin,
                        h = c.end,
                        p = n.begin,
                        u = n.end;
                      d >= p && h < u ? (r = !1) : p >= d && u < h && (r = !0);
                    }
                  }
                  switch (!0) {
                    case o:
                      var f = this.data.doc.comments.getCommentByRcId(a);
                      f &&
                        this.selection.setPosition(f.body.begin, f.body.end, {
                          isSend: !0,
                          isClick: !0,
                        });
                      break;
                    case r:
                      this.selection.setPosition(n.begin + 1, n.end - 1);
                      break;
                    case e.inTable && !e.tableSelected:
                      this.selectTable();
                      break;
                    case this.selection.selContext.isInTextbox:
                      if (!this.selection.begin) return;
                      var g = this.selection.data.doc.textboxs.isInTextbox(
                        this.selection.begin.position
                      );
                      this.selection.setPosition(g.pos, g.pos + g.len, {
                        isSend: !0,
                      });
                      break;
                    case this.selection.selContext.isInHeaderFooter:
                      if (!this.selection.begin) return;
                      var y = this.selection.begin.position,
                        _ = this.selection.end.position,
                        P = this.data.doc.getLimitedRange(
                          Math.floor((y + _) / 2)
                        );
                      this.selection.setPosition(P.pos, P.pos + P.len, {
                        isSend: !0,
                      });
                      break;
                    case this.selection.selContext.isInFootnote:
                      var T = this.data.doc.getSubDocRange(v.Footnote),
                        S = T.pos,
                        x = T.len;
                      this.selection.setPosition(S, S + x, { isSend: !0 });
                      break;
                    case this.selection.selContext.isInEndnote:
                      var b = this.data.doc.getSubDocRange(v.Endnote),
                        C = b.pos,
                        L = b.len;
                      this.selection.setPosition(C, C + L, { isSend: !0 });
                      break;
                    default:
                      var m = this.data.doc.concernRanges[0],
                        I = m.pos,
                        R = m.len;
                      this.selection.setPosition(I, I + R, { isSend: !0 });
                  }
                }
              },
            },
            {
              key: "selectCrossBlock",
              value: function (e, t, i) {
                var n = this,
                  o = (e && e.position) || e,
                  a = (t && t.position) || t,
                  s = o && a && o > a,
                  r = function (e) {
                    if (!e) return e;
                    var t = e.hyperLink,
                      i = e.position,
                      o = i || e;
                    if (!i) {
                      var a = n.data.doc.fields.getField(o);
                      a && a.begin < o && a.end > o && (t = new R.a(n.data, a));
                    }
                    return t && (t.isMentionAddress() || t.isFileLinkAddress())
                      ? { begin: t.field.begin, end: t.field.end }
                      : null;
                  },
                  l = r(e),
                  c = r(t);
                if (l) {
                  var d = s ? l.end : l.begin;
                  o = new P.a(this.selection, d);
                }
                if (c) {
                  var h = s ? c.begin : c.end;
                  a = new P.a(this.selection, h);
                }
                this.selection.setPosition(o, a, i);
              },
            },
            {
              key: "adjustLinkSelection",
              value: function () {
                var e = this.selection.getActiveAreaNormalRanges(),
                  t = e[0];
                t.pos > e[e.length - 1].pos && (t = e[e.length - 1]);
                var i = t.pos,
                  n = t.pos + t.len;
                if (i !== n) {
                  var o = this.data.doc.getDataLogic("final").getPapx(n - 1);
                  n === o.pos + o.len &&
                    o.prop.getPropVal("para_type") === S.a &&
                    (--n, this.selection.setPosition(i, n));
                }
              },
            },
            {
              key: "_getDocumentFields",
              value: function (e) {
                var t = [],
                  i = [];
                return (
                  this.data.doc.documentFields
                    .getFields({ begin: e, end: e + 1 })
                    .forEach(function (e) {
                      var n = e._node;
                      n.len ? t.push(n) : i.push(n);
                    }),
                  {
                    documentFields: t.sort(function (e, t) {
                      var i = e.pos,
                        n = t.pos;
                      if (i === n) {
                        var o = i + e.len - (n + t.len);
                        return 0 == o ? (e.name < t.name ? -1 : 1) : o;
                      }
                      return n - i;
                    }),
                    documentFieldCards: i.sort(function (e, t) {
                      return e.name < t.name ? -1 : 1;
                    }),
                  }
                );
              },
            },
            {
              key: "getHyperlink",
              value: function (e) {
                var t = this.data.doc.fields.getField(e);
                if (t && t.begin !== e) {
                  var i = new R.a(this.data, t);
                  return {
                    isSkipPos: i.isMentionAddress() || i.isFileLinkAddress(),
                    position: { begin: t.begin, end: t.end },
                  };
                }
                return { isSkipPos: !1 };
              },
            },
            {
              key: "_isLineBreak",
              value: function (e) {
                if (e < 0) return !1;
                var t = this.data.doc.getText(e, 1).charCodeAt(0);
                return b.default.isLineBreak(t);
              },
            },
            {
              key: "nextPosition",
              value: function () {
                this.selection.clearCache();
                var e = this.selection.getNormalRange(),
                  t = new P.a(this.selection, e.pos + e.len),
                  i = [];
                if (0 == e.len) {
                  var n = this.selection.selContext.activeDocumentFieldNames,
                    o = this.data.doc.documentFields,
                    a = t.position,
                    r = !1,
                    l = !1,
                    c = !1;
                  if (n && n.length) {
                    var d = n[0],
                      h = o.getFieldByName(d);
                    if (
                      h &&
                      h.end == a &&
                      ((i = [].concat(s()(n))).splice(0, 1),
                      (r = !0),
                      0 == h.len)
                    ) {
                      var p = this._getDocumentFields(a).documentFieldCards,
                        u = p.findIndex(function (e) {
                          return e.name == h.name;
                        });
                      u >= 0 && u < p.length - 1
                        ? i.splice(0, 0, p[u + 1].name)
                        : (c = !0);
                    }
                  }
                  if (!r) {
                    var f = this._getDocumentFields(a),
                      g = f.documentFields,
                      v = f.documentFieldCards;
                    if (n && n.length) {
                      for (
                        var y = n.length - 1, T = g.length - 1;
                        y >= 0 && n[y] == g[T].name;

                      )
                        i.splice(0, 0, n[y]), --y, --T;
                      y <= 0 && T >= 0
                        ? g[T].pos === a &&
                          ((l = !0), i.splice(0, 0, g[T].name))
                        : y < 0 &&
                          T < 0 &&
                          v.length &&
                          (i.splice(0, 0, v[0].name), (l = !0));
                    } else
                      g.length
                        ? (i.push(g[g.length - 1].name), (l = !0))
                        : v.length && (i.push(v[0].name), (l = !0));
                  }
                  if (c || (!r && !l)) {
                    var E = this.getHyperlink(t.position + 1),
                      S = E.isSkipPos,
                      x = E.position;
                    t = S
                      ? new P.a(this.selection, x.end)
                      : new P.a(
                          this.selection,
                          _.moveNextPosition(this.data, t)
                        );
                  }
                  if (this._isLineBreak(t.position - 1) && i && i.length)
                    for (; i.length; ) {
                      var b = o.getFieldByName(i[0]);
                      if (b.begin === b.end || b.end !== t.position) break;
                      i.splice(0, 1);
                    }
                }
                var C = t.position,
                  L = _.getLimitedRange(
                    this.data,
                    e.pos + Math.floor(e.len / 2)
                  );
                if (L.pos + L.len === C) t = C - 1;
                else {
                  var m = this.data.glyphpool.getGlyphIterator(C),
                    I = m.glyphGroup;
                  I.isCombine && I.pos !== C && (t = I.end), m.free();
                }
                this.selection.setPosition(t, null, {
                  isSend: !0,
                  activateCtrl: !0,
                  isClick: !0,
                  isChangedByFuncKeys: !0,
                  funcKey: "right",
                  documentFieldNames: i,
                });
              },
            },
            {
              key: "previousPosition",
              value: function () {
                this.selection.clearCache();
                var e = this.selection.getNormalRange(),
                  t = new P.a(this.selection, e.pos),
                  i = [],
                  n = {
                    isSend: !0,
                    activateCtrl: !0,
                    isClick: !0,
                    isChangedByFuncKeys: !0,
                    funcKey: "left",
                  };
                if (0 == e.len) {
                  var o = this.selection.selContext.activeDocumentFieldNames,
                    a = this.data.doc.documentFields,
                    r = t.position,
                    l = !1,
                    c = !1,
                    d = !1;
                  if (o && o.length) {
                    var h = o[0],
                      p = a.getFieldByName(h);
                    if (
                      p &&
                      p.pos == r &&
                      ((i = [].concat(s()(o))).splice(0, 1),
                      (l = !0),
                      0 == p.len)
                    ) {
                      var u = this._getDocumentFields(r).documentFieldCards,
                        f = u.findIndex(function (e) {
                          return e.name == p.name;
                        });
                      f > 0 ? i.splice(0, 0, u[f - 1].name) : (d = !0);
                    }
                  }
                  if (!l && r > 0) {
                    var g = this._getDocumentFields(
                        Math.max(0, r - 1)
                      ).documentFields,
                      v = this._getDocumentFields(r).documentFieldCards;
                    if (o && o.length) {
                      for (
                        var y = o.length - 1, T = g.length - 1;
                        y >= 0 && o[y] == g[T].name;

                      )
                        i.splice(0, 0, o[y]), --y, --T;
                      y <= 0 && T >= 0
                        ? g[T].end === r &&
                          ((c = !0), i.splice(0, 0, g[T].name))
                        : y < 0 &&
                          T < 0 &&
                          v.length &&
                          (i.splice(0, 0, v[v.length - 1].name), (c = !0));
                    } else
                      g.length
                        ? (i.push(g[g.length - 1].name), (c = !0))
                        : v.length &&
                          (i.splice(0, 0, v[v.length - 1].name), (c = !0));
                  }
                  if (d || (!l && !c)) {
                    var E = this.getHyperlink(t.position - 1),
                      S = E.isSkipPos,
                      x = E.position;
                    t = S ? x.begin : _.movePreviousPosition(this.data, t);
                  } else if (
                    this._isLineBreak(t.position - 1) &&
                    i &&
                    i.length
                  ) {
                    var b = a.getFieldByName(i[0]);
                    b.begin !== b.end &&
                      b.end === t.position &&
                      (t = _.movePreviousPosition(this.data, t));
                  }
                }
                if (null !== t) {
                  var C = Number.isInteger(t) ? t : t.position,
                    L = this.data.glyphpool.getGlyphIterator(C),
                    m = L.glyphGroup;
                  m.isCombine && m.pos !== C && (t = m.pos),
                    L.free(),
                    (n.documentFieldNames = i),
                    this.selection.setPosition(t, t, n);
                }
              },
            },
            {
              key: "upPosition",
              value: function () {
                this.selection.clearCache();
                var e = {
                  isSend: !0,
                  activateCtrl: !0,
                  isClick: !0,
                  isChangedByFuncKeys: !0,
                  funcKey: "up",
                };
                if (this.isRestrictEditMode)
                  this.formatContentController.keyUpHandler();
                else {
                  var t = this.selection,
                    i = t.begin,
                    n = t.end,
                    o = i.position > n.position ? n : i,
                    a = _.moveUpPosition(this.data, o);
                  if (null !== a) {
                    var s = this.getHyperlink(a.position),
                      r = s.isSkipPos,
                      l = s.position;
                    r
                      ? this.selection.setPosition(l.begin, l.end, e)
                      : this.selection.setPosition(a, null, e);
                  } else {
                    if (!this.selection.selInfo.isInTable()) {
                      var c = n.pos.line.range;
                      this.selection.setPosition(c.begin, null, e);
                    }
                  }
                }
              },
            },
            {
              key: "downPosition",
              value: function () {
                this.selection.clearCache();
                var e = {
                  isSend: !0,
                  activateCtrl: !0,
                  isClick: !0,
                  isChangedByFuncKeys: !0,
                  funcKey: "down",
                };
                if (this.isRestrictEditMode)
                  this.formatContentController.keyDownHandler();
                else {
                  var t = this.selection,
                    i = t.begin,
                    n = t.end,
                    o = i.position > n.position ? i : n,
                    a = _.moveDownPosition(this.data, o);
                  if (null !== a) {
                    var s = this.getHyperlink(a.position),
                      r = s.isSkipPos,
                      l = s.position;
                    r
                      ? this.selection.setPosition(l.begin, l.end, e)
                      : this.selection.setPosition(a, null, e);
                  } else {
                    if (!this.selection.selInfo.isInTable()) {
                      var c = n.pos.line.range;
                      this.selection.setPosition(c.end - 1, null, e);
                    }
                  }
                }
              },
            },
            {
              key: "_keyboardSelectGetNoSpaceSentence",
              value: function (e) {
                for (
                  var t = e.position,
                    i = e.sentence,
                    n = e.final,
                    o = e.type,
                    a = n.getPapx(t),
                    s = a.pos,
                    r = a.len,
                    l = !1;
                  t >= 0 && (!i || !i.fragment);

                ) {
                  if (((l = !0), "left" === o && t > s)) {
                    if (
                      ((t -= 1),
                      this.verificationSpecialChar(
                        Object(m.getPureText)(this.data, void 0, [
                          { pos: t - 1, len: 1 },
                        ])
                      ))
                    )
                      break;
                  } else {
                    if (!("right" === o && t < s + r - 1)) break;
                    if (
                      ((t += 1),
                      this.verificationSpecialChar(
                        Object(m.getPureText)(this.data, void 0, [
                          { pos: t, len: 1 },
                        ])
                      ))
                    )
                      break;
                  }
                  i = n.specHidden.getSentenceByPunctuation({ position: t });
                }
                return { position: t, sentence: i, isEndIsEmpty: l };
              },
            },
            {
              key: "verificationSpecialChar",
              value: function (e) {
                return /[`~!@#¥$%^&*()_\-+=<>?:"{}|,./;'\\[\]·~！@#￥%……&*（）——\-+={}|《》？：“”【】、；‘’，。、]/im.test(
                  e
                );
              },
            },
            {
              key: "reverseDirection",
              value: function (e, t) {
                var i = this.data.doc.getDataLogic("final").getPapx(e);
                if (i && i.prop && i.prop.bidi) {
                  switch (t) {
                    case "left":
                      this.previousPosition();
                      break;
                    case "right":
                      this.nextPosition();
                      break;
                    case "lightleft":
                      this.moveLeft();
                      break;
                    case "lightright":
                      this.moveRight();
                  }
                  return !0;
                }
                return !1;
              },
            },
            {
              key: "keyboardSelectLeftWords",
              value: function () {
                var e = this,
                  t = this.selection,
                  i = t.begin,
                  n = t.end,
                  o = i.position,
                  a = n.position;
                if (!this.reverseDirection(a, "left")) {
                  var s = o < a,
                    r = a,
                    l = this.data.doc,
                    c = l.getLimitedRange(r),
                    d = l.getDataLogic("final"),
                    h = c.pos,
                    p = d.getPapx(r).pos,
                    u = t.selInfo.getSelectionInfo(),
                    f = u.ctrls,
                    g = f && f.length > 0,
                    v = t.selContext.isInHeaderFooter,
                    y = o === a,
                    P = { isClick: !0, isSend: !0, isChangedByFuncKeys: !0 };
                  if (!((0 === a && y) || a <= h || (v && y && h === a)))
                    if (y || g)
                      if (u.wholeCellSelected) this.moveLeft();
                      else {
                        if (
                          g &&
                          this.formatContentController.checkIsDefaultContent(
                            f[0]
                          )
                        )
                          return void t.setPosition(
                            o <= 2 ? 0 : o - 2,
                            null,
                            P
                          );
                        if ((a <= h && t.setPosition(h, null, P), p === r))
                          return void t.setPosition(r - 1, null, P);
                        var T = o - 1 < 0 ? 0 : o - 1,
                          E = Object(m.getPureText)(this.data, void 0, [
                            { pos: T, len: 1 },
                          ]);
                        if (
                          T > h &&
                          ("." === E
                            ? !(T > 0) ||
                              !w.test(
                                Object(m.getPureText)(this.data, void 0, [
                                  { pos: T - 1, len: 1 },
                                ])
                              )
                            : this.verificationSpecialChar(E))
                        )
                          return void this.previousPosition();
                        var S = d.specHidden.getSentenceByPunctuation({
                            position: r,
                          }),
                          x = S,
                          b = this._keyboardSelectGetNoSpaceSentence({
                            position: r,
                            sentence: S,
                            final: d,
                            type: "left",
                          });
                        (r = b.position), (S = b.sentence);
                        var C = d.specHidden.getSentenceByPunctuation({
                          position: r - 1,
                        });
                        if (!x && S && 0 === S.index)
                          return void this.selection.setPosition(r, null, P);
                        if (!C) {
                          S = C;
                          var L = this._keyboardSelectGetNoSpaceSentence({
                            position: r,
                            sentence: S,
                            final: d,
                            type: "left",
                          });
                          (r = L.position), (S = L.sentence);
                        }
                        if (!S)
                          return void this.selection.setPosition(r, null, P);
                        var I = S,
                          R = I.fragment,
                          A = void 0 === R ? {} : R,
                          H = I.index,
                          k = A.range,
                          O = void 0 === k ? {} : k,
                          F = A.text,
                          D = void 0 === F ? "" : F,
                          B = !1;
                        if (T >= 0) {
                          var N = this.data.doc.getText(T, 1);
                          B =
                            w.test(N) ||
                            ("." === N &&
                              T > 0 &&
                              w.test(this.data.doc.getText(T - 1, 1)));
                        }
                        var M = function (t) {
                          if (t && t[0] < 0)
                            e._unSupportSpliteWords({ range: O, type: "left" });
                          else {
                            var i = d.specHidden.getCutRangeForIndex(t, H, A),
                              n = i.begin,
                              o = n,
                              s = !1;
                            a === n &&
                              ((s = !0),
                              (i = d.specHidden.getCutRangeForIndex(
                                t,
                                H - 1,
                                A
                              ))),
                              (o = i.begin) === n &&
                                null != l.fields.getField(o - 1) &&
                                a === n + 1 &&
                                (o = (i = d.specHidden.getCutRangeForIndex(
                                  t,
                                  H - 2,
                                  A
                                )).begin),
                              0 === H &&
                                s &&
                                (o = _.movePreviousPosition(e.data, {
                                  position: o,
                                })),
                              e.selection.setPosition(o < h ? h : o, null, P),
                              window.APP.workspace.makesureCursorVisible();
                          }
                        };
                        if (window.Jieba && window.InitJiebaCompleted && !B)
                          window.Jieba.cut(D, M);
                        else
                          M(
                            (B &&
                              window.APP.thaiDict &&
                              window.APP.thaiDict.cut(D)) || [-1]
                          );
                      }
                    else t.setPosition(s ? o : a, null, P);
                }
              },
            },
            {
              key: "keyboardSelectRightWords",
              value: function () {
                var e = this,
                  t = this.selection,
                  i = t.begin,
                  n = t.end,
                  o = i.position,
                  a = n.position;
                if (!this.reverseDirection(a, "right")) {
                  var s = o < a,
                    r = a,
                    l = this.data.doc,
                    c = l.getLimitedRange(r),
                    d = l.getDataLogic("final"),
                    h = c.pos,
                    p = c.len,
                    u = d.getPapx(r),
                    f = u.pos,
                    g = u.len,
                    v = !1,
                    y = t.selInfo.getSelectionInfo(),
                    P = y.ctrls,
                    T = P && P.length > 0,
                    E = h + p,
                    S = o === a,
                    x = { isClick: !0, isSend: !0, isChangedByFuncKeys: !0 };
                  if (!(a >= E)) {
                    if (!S && !T) {
                      var b = a,
                        C = l.getLimitedRange(o);
                      return (
                        b === C.pos + C.len && (b -= 1),
                        void t.setPosition(s ? b : o, null, x)
                      );
                    }
                    if (y.wholeCellSelected) this.moveRight();
                    else {
                      if (
                        T &&
                        this.formatContentController.checkIsDefaultContent(P[0])
                      )
                        return void t.setPosition(a + 1, null, x);
                      if (_.moveNextPosition(this.data, n) >= E - 1)
                        return void t.setPosition(E - 1, null, x);
                      if (f + g === r + 1)
                        return void t.setPosition(r + 1, null, x);
                      var L = Object(m.getPureText)(this.data, void 0, [
                        { pos: a, len: 1 },
                      ]);
                      if (
                        "." === L
                          ? !(a > 0) ||
                            !w.test(
                              Object(m.getPureText)(this.data, void 0, [
                                { pos: a - 1, len: 1 },
                              ])
                            )
                          : this.verificationSpecialChar(L)
                      )
                        return void this.nextPosition();
                      var I = d.specHidden.getSentenceByPunctuation({
                          position: r,
                        }),
                        R = this._keyboardSelectGetNoSpaceSentence({
                          position: r,
                          sentence: I,
                          final: d,
                          type: "right",
                        });
                      if (
                        ((r = R.position),
                        (I = R.sentence),
                        (v = R.isEndIsEmpty))
                      ) {
                        var A = l.fields.getField(r),
                          H =
                            null !== A && a === A.begin ? A.resultBegin + 1 : r;
                        return void t.setPosition(H, null, x);
                      }
                      var k = I,
                        O = k.fragment,
                        F = void 0 === O ? {} : O,
                        D = k.index,
                        B = F.range,
                        N = void 0 === B ? {} : B,
                        M = F.text,
                        U = void 0 === M ? "" : M,
                        G = !1;
                      if (a >= 0) {
                        var W = this.data.doc.getText(a, 1);
                        G =
                          w.test(W) ||
                          ("." === W &&
                            a > 0 &&
                            w.test(this.data.doc.getText(a - 1, 1)));
                      }
                      var z = function (i) {
                        if (i && i[0] < 0)
                          e._unSupportSpliteWords({ range: N, type: "right" });
                        else {
                          var n = d.specHidden.getCutRangeForIndex(i, D, F),
                            r = s ? a : o,
                            l = n.begin,
                            c = n.end,
                            u = v ? l : c,
                            f = h + p;
                          (c >= f - 1 || l >= f - 1) && (u = f - 1),
                            t.setPosition(S ? u : r, null, x),
                            window.APP.workspace.makesureCursorVisible();
                        }
                      };
                      if (
                        window.Jieba &&
                        window.InitJiebaCompleted &&
                        !/^[_A-Za-z0-9]+$/.test(U) &&
                        !G
                      )
                        window.Jieba.cut(U, z);
                      else
                        z(
                          (G &&
                            window.APP.thaiDict &&
                            window.APP.thaiDict.cut(U)) || [-1]
                        );
                    }
                  }
                }
              },
            },
            {
              key: "keyboardLightSelectLeftWords",
              value: function () {
                var e = this,
                  t = this.selection,
                  i = t.begin,
                  n = t.end,
                  o = i.position,
                  a = n.position;
                if (!this.reverseDirection(a, "lightleft")) {
                  var s = o < a,
                    r = a,
                    l = this.data.doc,
                    c = l.getLimitedRange(r),
                    d = l.getDataLogic("final"),
                    h = c.pos,
                    p = d.getPapx(r),
                    u = p.pos,
                    f = p.len,
                    g = t.selInfo.getSelectionInfo(),
                    v = g.ctrls,
                    y = v && v.length > 0,
                    P = t.selContext.isInHeaderFooter,
                    T = o === a,
                    E = !1,
                    x = { isClick: !0, isSend: !0, isChangedByFuncKeys: !0 };
                  if (!((0 === a && T) || (P && T && h === a)))
                    if (g.wholeCellSelected) this.moveLeft();
                    else {
                      if (y) {
                        var b = v[v.length - 1],
                          C =
                            this.formatContentController.checkIsDefaultContent(
                              b
                            ),
                          L = b.begin - 1 <= 0 ? 0 : b.begin - 1;
                        if ((a === b.begin || a === b.end) && C)
                          return void t.setPosition(o, L, x);
                      }
                      var I = _.movePreviousPosition(this.data, n);
                      if (
                        g.cells &&
                        (I < g.cells[0][0].begin || I >= g.cells[0][0].end)
                      )
                        return void this.moveLeft();
                      var R = a - 1 < 0 ? 0 : a - 1,
                        A = Object(m.getPureText)(this.data, void 0, [
                          { pos: R, len: 1 },
                        ]);
                      if (
                        R > h && "." === A
                          ? !(R > 0) ||
                            !w.test(
                              Object(m.getPureText)(this.data, void 0, [
                                { pos: R - 1, len: 1 },
                              ])
                            )
                          : this.verificationSpecialChar(A)
                      )
                        return void this.moveLeft();
                      var H = d.specHidden.getSentenceByPunctuation({
                          position: r,
                        }),
                        k = H;
                      if (!H) {
                        var O = a - 2 < 0 ? 0 : a - 2,
                          F = Object(m.getPureText)(this.data, void 0, [
                            { pos: O, len: 1 },
                          ]);
                        if (O > h && this.verificationSpecialChar(F)) {
                          var D = l.fields.getField(O);
                          return void (null != D
                            ? t.setPosition(o, D.begin, x)
                            : this.moveLeft());
                        }
                      }
                      var B = this._keyboardSelectGetNoSpaceSentence({
                        position: r,
                        sentence: H,
                        final: d,
                        type: "left",
                      });
                      if (
                        ((r = B.position),
                        (H = B.sentence),
                        !k && H && 0 === H.index)
                      )
                        return void this.selection.setPosition(o, r, x);
                      var N = r - 1 <= 0 ? 0 : r - 1;
                      H || t.setPosition(o, t.selInfo.isInTable(a) ? u : N, x);
                      var M = d.specHidden.getSentenceByPunctuation({
                        position: r - 1,
                      });
                      if (!M) {
                        if (!(H = M)) {
                          var U = N,
                            G = t.selInfo.isInTable(a);
                          G && ((E = !0), (U = u)),
                            G && !t.selInfo.isInTable(o) && (U = N),
                            t.setPosition(o, U, x);
                        }
                        var W = this._keyboardSelectGetNoSpaceSentence({
                          position: r,
                          sentence: H,
                          final: d,
                          type: "left",
                        });
                        (r = W.position), (H = W.sentence);
                      }
                      if (!H) {
                        var z = d.getPapx(r - 1).prop;
                        if (!z) return;
                        if (P && a === h)
                          return void this.selection.setPosition(o, h, x);
                        var Y = z.para_type,
                          X = S.d === Y,
                          j = t.selInfo.isInTable(a);
                        return void (X && !E
                          ? (t.setPosition(o, a, x), this.moveUp())
                          : a === u && j && s
                          ? this.moveLeft()
                          : P && !M && a < u + f && a != u
                          ? t.setPosition(o, u, x)
                          : j && a === u && g.cells && this.moveLeft());
                      }
                      var K = H,
                        J = K.fragment,
                        V = void 0 === J ? {} : J,
                        Z = K.index,
                        $ = V.range,
                        Q = void 0 === $ ? {} : $,
                        q = V.text,
                        ee = void 0 === q ? "" : q,
                        te = !1;
                      if (R >= 0) {
                        var ie = this.data.doc.getText(R, 1);
                        te =
                          w.test(ie) ||
                          ("." === ie &&
                            R > 0 &&
                            w.test(this.data.doc.getText(R - 1, 1)));
                      }
                      var ne = function (t) {
                        if (t && t[0] < 0)
                          e._unSupportLightWords({
                            range: Q,
                            type: "left",
                            defaultBeginPosition: o,
                          });
                        else {
                          var i = d.specHidden.getCutRangeForIndex(t, Z, V),
                            n = i.begin;
                          a === n &&
                            (i = d.specHidden.getCutRangeForIndex(t, Z - 1, V)),
                            (n = i.begin);
                          var r = i.end,
                            c = n;
                          c === a && (c -= 1);
                          var h = l.fields.getField(c);
                          null != h && r !== a && s && (c = h.begin),
                            e.selection.setPosition(o, c < 0 ? 0 : c, x),
                            window.APP.workspace.makesureCursorVisible(!0);
                        }
                      };
                      if (window.Jieba && window.InitJiebaCompleted && !te)
                        window.Jieba.cut(ee, ne);
                      else
                        ne(
                          (te &&
                            window.APP.thaiDict &&
                            window.APP.thaiDict.cut(ee)) || [-1]
                        );
                    }
                }
              },
            },
            {
              key: "keyboardLightSelectRightWords",
              value: function () {
                var e = this,
                  t = this.selection,
                  i = t.begin,
                  n = t.end,
                  o = i.position,
                  a = n.position;
                if (!this.reverseDirection(a, "lightright")) {
                  var s = a,
                    r = this.data.doc,
                    c = r.getLimitedRange(s),
                    d = r.getDataLogic("final"),
                    h = c.pos,
                    p = c.len,
                    u = d.getPapx(s),
                    f = u.pos,
                    g = u.len,
                    v = t.selInfo.getSelectionInfo(),
                    y = v.ctrls,
                    P = y && y.length > 0,
                    T = h + p,
                    E = t.selContext.isInHeaderFooter,
                    x = o === a,
                    b = o > a,
                    C = { isClick: !0, isSend: !0, isChangedByFuncKeys: !0 };
                  if (!(a >= T || o < h))
                    if (v.wholeCellSelected) this.moveRight();
                    else {
                      if (P) {
                        var L = y[b ? 0 : y.length - 1],
                          I =
                            this.formatContentController.checkIsDefaultContent(
                              L
                            );
                        if (E && a + 1 === T && !b) return;
                        if ((a === L.begin && I) || a === L.end)
                          return void t.setPosition(o, L.end + 1, C);
                      }
                      var R = _.moveNextPosition(this.data, n),
                        A = t.getTableRange(a, !0);
                      if (
                        v.cells &&
                        (R < v.cells[0][0].begin || R >= v.cells[0][0].end)
                      )
                        return void this.moveRight();
                      if (null != A && A.begin === a && !x)
                        return void this.moveRight();
                      if (null != A && o > A.begin && a < A.end && o > a)
                        return void this.moveRight();
                      var H = Object(m.getPureText)(this.data, void 0, [
                        { pos: a, len: 1 },
                      ]);
                      if (
                        "." === H
                          ? !(a > 0) ||
                            !w.test(
                              Object(m.getPureText)(this.data, void 0, [
                                { pos: a - 1, len: 1 },
                              ])
                            )
                          : this.verificationSpecialChar(H)
                      )
                        return void this.moveRight();
                      var k = d.specHidden.getSentenceByPunctuation({
                          position: s,
                        }),
                        O = this._keyboardSelectGetNoSpaceSentence({
                          position: s,
                          sentence: k,
                          final: d,
                          type: "right",
                        });
                      if (
                        ((s = O.position), (k = O.sentence), O.isEndIsEmpty)
                      ) {
                        var F = d.getPapx(s + 1).prop,
                          D = this.selection.selInfo.getSelectionInfo(),
                          B = F.para_type,
                          N = S.b === B,
                          M = S.d === B;
                        if (N || D.wholeCellSelected || M)
                          return void (x && o > f && D.inTable
                            ? t.setPosition(o, s, C)
                            : this.moveDown());
                        if (a >= T - 1)
                          return void t.setPosition(o, E ? T - 1 : T, C);
                        var U = r.fields.getField(s),
                          G = null === U ? s : U.end,
                          W = this.verificationSpecialChar(
                            Object(m.getPureText)(this.data, void 0, [
                              { pos: s, len: 1 },
                            ])
                          );
                        return (
                          null != U &&
                            s > U.begin &&
                            s < U.end &&
                            !W &&
                            (G = s),
                          void t.setPosition(
                            o,
                            s + 1 === f + g ? s + 1 : G,
                            l()({}, C, { isSelectFormatControl: !0 })
                          )
                        );
                      }
                      var z = k,
                        Y = z.fragment,
                        X = void 0 === Y ? {} : Y,
                        j = z.index,
                        K = X.range,
                        J = void 0 === K ? {} : K,
                        V = X.text,
                        Z = void 0 === V ? "" : V,
                        $ = !1;
                      if (a >= 0) {
                        var Q = this.data.doc.getText(a, 1);
                        $ =
                          w.test(Q) ||
                          ("." === Q &&
                            a > 0 &&
                            w.test(this.data.doc.getText(a - 1, 1)));
                      }
                      var q = function (i) {
                        if (i && i[0] < 0)
                          e._unSupportLightWords({
                            range: J,
                            type: "right",
                            defaultBeginPosition: o,
                          });
                        else {
                          var n = d.specHidden.getCutRangeForIndex(i, j, X),
                            l = n.end,
                            c = n.begin,
                            h = r.fields.getField(c),
                            p = null != h,
                            u = p ? h.end : n.end;
                          if (
                            (((p && c === a && b) ||
                              (p && u === o && b) ||
                              (p && o > u && l > h.begin && h.begin === f)) &&
                              (l = u),
                            /^[_A-Za-z0-9]+$/.test(Z))
                          ) {
                            var g = e._keyboardSelectGetNoSpaceSentence({
                              position: l,
                              sentence: void 0,
                              final: d,
                              type: "right",
                            });
                            (s = g.position),
                              (k = g.sentence),
                              g.isEndIsEmpty,
                              (l = s);
                          }
                          t.setPosition(o, l, C),
                            window.APP.workspace.makesureCursorVisible(!0);
                        }
                      };
                      if (window.Jieba && window.InitJiebaCompleted && !$)
                        window.Jieba.cut(Z, q);
                      else
                        q(
                          ($ &&
                            window.APP.thaiDict &&
                            window.APP.thaiDict.cut(Z)) || [-1]
                        );
                    }
                }
              },
            },
            {
              key: "keyboardToParagraphHead",
              value: function () {
                var e = this.data,
                  t = e.doc,
                  i = e.selection,
                  n = i.begin,
                  o = void 0 === n ? {} : n,
                  a = i.end,
                  s = void 0 === a ? {} : a,
                  r = o.position,
                  l = s.position,
                  c = t.getDataLogic("final").getPapx(r),
                  d = c.pos,
                  h = c.prop,
                  p = i.selInfo.getSelectionInfo().ctrls,
                  u = t.getLimitedRange(r).pos,
                  f = i.selContext.isInHeaderFooter,
                  g = r === l,
                  v = l > r ? r : l,
                  y = { isClick: !0, isSend: !0, isChangedByFuncKeys: !0 };
                if (0 !== r) {
                  var P = _.moveUpPosition(e, o);
                  if (!P) {
                    var T = h.para_type,
                      E = t.getDataLogic("final").getPapx(d - 1).pos,
                      x = g ? u : v;
                    return (
                      (x = S.b === T ? d : x),
                      (x = (x = d === r ? E : x) < u ? u : x),
                      void i.setPosition(x, null, y)
                    );
                  }
                  if (P.position < u) i.setPosition(u, null, y);
                  else if (
                    p &&
                    p.length > 0 &&
                    this.formatContentController.checkIsDefaultContent(p[0])
                  ) {
                    var b = r <= 2 ? 0 : r - 2,
                      C = e.doc.getDataLogic("final").getPapx(b).pos;
                    i.setPosition(C, null, y);
                  } else if (d === r) {
                    if (f && !P) return void i.setPosition(d, null, y);
                    var L = e.doc
                      .getDataLogic("final")
                      .getPapx(i.begin.position - 1).pos;
                    i.setPosition(L < u ? u : L, null, y);
                  } else g ? this._handleShift(d) : this._handleShift(v);
                }
              },
            },
            {
              key: "keyboardToParagraphEnd",
              value: function () {
                var e = this.data,
                  t = e.doc,
                  i = e.selection,
                  n = i.begin,
                  o = void 0 === n ? {} : n,
                  a = i.end,
                  s = void 0 === a ? {} : a,
                  r = o.position,
                  l = s.position,
                  c = t.getDataLogic("final").getPapx(r),
                  d = c.pos,
                  h = c.len,
                  p = t.getLimitedRange(r),
                  u = d + h,
                  f = p.pos + p.len,
                  g = r === l,
                  v = l > r ? l : r,
                  y = g ? f - 1 : v,
                  P = { isClick: !0, isSend: !0, isChangedByFuncKeys: !0 };
                _.moveDownPosition(e, o)
                  ? u >= f
                    ? i.setPosition(y, null, P)
                    : this._handleShift(g ? u : v)
                  : i.setPosition(y, null, P);
              },
            },
            {
              key: "keyboardToSelectParagraphHead",
              value: function () {
                var e = this.data,
                  t = e.doc,
                  i = e.selection,
                  n = i.begin,
                  o = void 0 === n ? {} : n,
                  a = i.end,
                  s = void 0 === a ? {} : a,
                  r = o.position,
                  l = s.position,
                  c = t.getDataLogic("final"),
                  d = c.getPapx(l),
                  h = d.pos,
                  p = d.prop,
                  u = t.getLimitedRange(l).pos,
                  f = h;
                if (0 !== l && (0 !== r || 0 !== l)) {
                  var g = i.selInfo.getSelectionInfo(),
                    v = g.ctrls,
                    y = v && v.length > 0,
                    _ = p.para_type,
                    P = { isClick: !0, isSend: !0, isChangedByFuncKeys: !0 };
                  if (y) {
                    var T = v[v.length - 1],
                      E = l === T.begin || l === T.end,
                      x = r === T.begin + 1 && l === T.end - 1;
                    if (E || x) {
                      var b = T.begin - 1,
                        C = c.getPapx(b);
                      return (
                        C && C.pos + C.len === T.begin && (b = C.pos),
                        void i.setPosition(r, b, P)
                      );
                    }
                  }
                  if (g.wholeCellSelected || S.d === _ || g.rowSelected)
                    this.moveUp();
                  else {
                    var L = c.getPapx(h - 1 < 0 ? 0 : h - 1),
                      m = i.selContext.isInHeaderFooter,
                      I = m && r === l && r === u;
                    if (!L) {
                      if (I) return;
                      return void (r > l
                        ? i.setPosition(r, u, P)
                        : i.setPosition(r, c.getPapx(l - 1).pos, P));
                    }
                    var R = L.pos;
                    if (
                      m &&
                      R < u &&
                      r === u - 1 &&
                      13 != e.glyphpool.glyphBuff.getCharCode(r)
                    )
                      return;
                    if (R < u) {
                      if (I) return;
                      var w = c.getPapx(l - 1).pos;
                      return void i.setPosition(r, r > l ? u : w, P);
                    }
                    if (
                      g.cells &&
                      (R < g.cells[0][0].begin || R >= g.cells[0][0].end)
                    ) {
                      var A = c.getPapx(l),
                        H = A.prop,
                        k = A.len,
                        O = A.pos,
                        F = H.nest_level,
                        D = c.getPapx(r - 1).prop.para_type;
                      return void (F > 0 && r === l && k > 1 && r != O
                        ? i.setPosition(r, c.getPapx(l).pos, P)
                        : S.d === D && r !== l
                        ? i.setPosition(r, R, P)
                        : this.moveUp());
                    }
                    if (h === l) {
                      var B = c.getPapx(l - 1),
                        N = B.pos,
                        M = B.prop.para_type;
                      if (S.d === M) f = c.specTable.getTapx(l - 1).pos;
                      else f = N;
                      if (m && f < u) return;
                    }
                    i.setPosition(r, f, P);
                  }
                }
              },
            },
            {
              key: "keyboardToSelectParagraphEnd",
              value: function () {
                var e = this.data,
                  t = e.doc,
                  i = t.getDataLogic("final"),
                  n = e.selection,
                  o = n.begin,
                  a = void 0 === o ? {} : o,
                  s = n.end,
                  r = void 0 === s ? {} : s,
                  c = a.position,
                  d = r.position,
                  h = r.pos,
                  p = i.getPapx(d),
                  u = p.pos,
                  f = u + p.len,
                  g = n.selInfo.getSelectionInfo(),
                  v = t.getLimitedRange(c),
                  y = v.pos,
                  _ = v.len,
                  P = h.line,
                  T = void 0 === P ? {} : P,
                  E = { isClick: !0, isSend: !0, isChangedByFuncKeys: !0 };
                if (g.wholeCellSelected || g.tableSelected) this.moveDown();
                else {
                  var S = i.getPapx(d + 1),
                    x = g.inTable,
                    b = g.cells;
                  if (!S) return void n.setPosition(c, y + _, E);
                  var C = S.pos,
                    L = y + _;
                  if (C >= L) return void n.setPosition(c, L, E);
                  if (b && C > f && c === d && d != f - 1)
                    return void n.setPosition(c, f - 1, E);
                  if (b && (C < b[0][0].begin || C >= b[0][0].end)) {
                    var m = n.getTableRange(d - 1, !0);
                    if (null == m || m.end !== d) return void this.moveDown();
                  }
                  if (
                    (x && b[0][0].end === f && (f -= 1),
                    T.isInTable && u === d && !x)
                  ) {
                    var I = n.getTableRange(d - 1, !0);
                    if (null == I || I.end !== d) return void this.moveDown();
                  }
                  n.setPosition(
                    c,
                    f,
                    l()({}, E, { isSelectFormatControl: !0 })
                  );
                }
              },
            },
            {
              key: "_unSupportSpliteWords",
              value: function (e) {
                var t = this.data.doc.getDataLogic("final"),
                  i = e.range,
                  n = void 0 === i ? {} : i,
                  o = e.selectCB,
                  a = e.type,
                  s = n.begin,
                  r = n.end,
                  l = this._keyboardSelectGetNoSpaceSentence({
                    position: r,
                    final: t,
                    type: a,
                  }).position;
                this.selection.setPosition("left" === a ? s : l, null, {
                  isSend: !0,
                  isChangedByFuncKeys: !0,
                }),
                  o && o();
              },
            },
            {
              key: "_unSupportLightWords",
              value: function (e) {
                var t = e.range,
                  i = void 0 === t ? {} : t,
                  n = e.selectCB,
                  o = e.defaultBeginPosition,
                  a = e.type,
                  s = i.begin,
                  r = i.end;
                this.selection.setPosition(o, "left" === a ? s : r, {
                  isSend: !0,
                  isChangedByFuncKeys: !0,
                }),
                  n && n();
              },
            },
            {
              key: "_isIncompleteCellRange",
              value: function (e) {
                var t = e.inTable,
                  i = e.wholeCellSelected,
                  n = e.rowCnt,
                  o = e.columnCnt;
                return t && !i && n * o == 1;
              },
            },
            {
              key: "_isCompleteSingleCellRange",
              value: function (e) {
                var t = e.inTable,
                  i = e.wholeCellSelected,
                  n = e.rowCnt,
                  o = e.columnCnt;
                return t && i && n * o == 1;
              },
            },
            {
              key: "_getPositionInfo",
              value: function (e, t, i) {
                var n = this.data.doc.getDataLogic("final"),
                  o = (n.getPapx(e) || {}).prop || {},
                  a = o.nest_level,
                  s = void 0 === a ? 0 : a,
                  r = o.type,
                  l = (n.getPapx(t) || {}).prop || {},
                  c = l.para_type,
                  d = l.nest_level,
                  h = void 0 === d ? 0 : d,
                  p = l.type,
                  u = (n.getPapx(i) || {}).prop || {},
                  f = u.nest_level,
                  g = void 0 === f ? 0 : f,
                  v = u.type,
                  y = {};
                return (
                  c === S.d &&
                    g >= h &&
                    v === p &&
                    (y.isAcrossHorizontalBound = !0),
                  (h < s || g < h || p !== r || v !== p) &&
                    (y.isAcrossVerticalBound = !0),
                  y
                );
              },
            },
            {
              key: "_extendSelectionInSingleCell",
              value: function (e, t) {
                var i = this.selection,
                  n = i.begin.position,
                  a = i.end.position,
                  s = n > a ? [a, n] : [n, a],
                  r = o()(s, 2);
                (n = r[0]), (a = r[1]);
                var l = Object(E.getCellRangeByPos)(this.data.doc, n),
                  c = { isSend: !0, isChangedByFuncKeys: !0 };
                if (null !== e && l.begin <= e && l.end > e && e !== a)
                  this.selection.setPosition(
                    this.selection.begin,
                    new P.a(this.selection, e)
                  );
                else {
                  var d = l.begin === n && l.end === a + 1;
                  null === e ||
                    (d && l.begin !== l.end - 1) ||
                    this._saveCachedSelectionInfo({
                      innerCellPos: this.selection.end.position,
                    }),
                    null !== e && t
                      ? d
                        ? this.selection.setPosition(l.begin, l.end, c)
                        : this.selection.setPosition(l.begin, l.end - 1, c)
                      : d
                      ? this.selection.setPosition(l.end, l.begin, c)
                      : this.selection.setPosition(l.end - 1, l.begin, c);
                }
              },
            },
            {
              key: "_extendSelectionInRows",
              value: function (e, t, i) {
                var n,
                  o = e ? t.begin : i.begin,
                  a = e ? i.end : t.end,
                  r = Object(E.collectRows)(this.data.doc, o, a).range;
                (n = this.selection).setPosition.apply(
                  n,
                  s()(e ? [r.end, r.begin] : [r.begin, r.end]).concat([
                    { isSend: !0, isChangedByFuncKeys: !0 },
                  ])
                );
              },
            },
            {
              key: "_getRelatedCell",
              value: function (e, t) {
                var i = t.cells;
                if (!i) return null;
                for (var n = 0, o = i.length; n < o; n++)
                  for (var a = 0, s = i[n].length; a < s; a++) {
                    var r = i[n][a];
                    if (r.begin <= e && r.end >= e) return r;
                  }
                return this.data.doc.getDataLogic("final").getPapx(e - 1).prop
                  .para_type === S.d
                  ? this._getRelatedCell(e - 1, t)
                  : null;
              },
            },
            {
              key: "_saveCachedSelectionInfo",
              value: function (e) {
                var t = e.innerTablePos,
                  i = e.innerCellPos,
                  n = e.isSaveRanges;
                this.cachedSelectionInfo = l()(
                  {},
                  this.cachedSelectionInfo,
                  void 0 !== t ? { innerTablePos: t } : {},
                  void 0 !== i ? { innerCellPos: i } : {},
                  n ? { ranges: this.selection.selAreas._areas[0]._ranges } : {}
                );
              },
            },
            {
              key: "_restoreSelectionRanges",
              value: function () {
                return (
                  !!this.cachedSelectionInfo.ranges &&
                  (this.selection.setRanges(
                    this.cachedSelectionInfo.ranges,
                    {}
                  ),
                  delete this.cachedSelectionInfo.ranges,
                  !0)
                );
              },
            },
            {
              key: "_restorePosition",
              value: function (e) {
                var t = e;
                void 0 !== this.cachedSelectionInfo.innerCellPos &&
                  (t = this.cachedSelectionInfo.innerCellPos),
                  this.selection.setPosition(t, null, {
                    preventScroll: !0,
                    isSend: !0,
                    isChangedByFuncKeys: !0,
                  });
              },
            },
            {
              key: "_revertTableLineRange",
              value: function (e, t) {
                var i = this.selection.getNormalRange(),
                  n = i.pos,
                  o = i.pos + i.len,
                  a = void 0;
                if (e) {
                  if (
                    t &&
                    (this.data.doc.getDataLogic("final").getPapx(n).prop || {})
                      .nest_level >= 1
                  ) {
                    var s = this.data.doc.getDataLogic("final"),
                      r = Object(x.getTopLevel)(s, n, o),
                      l = s.specTable.getTapx(n, void 0, r + 1);
                    l.prop && (a = l.end);
                  }
                } else if (
                  !t &&
                  (
                    this.data.doc.getDataLogic("final").getPapx(o - 1).prop ||
                    {}
                  ).para_type === S.d
                ) {
                  var c = this.data.doc
                    .getDataLogic("final")
                    .specTable.getTapx(o - 1);
                  c.prop && (a = c.begin);
                }
                return a;
              },
            },
            {
              key: "moveLeft",
              value: function () {
                var e = this.selection,
                  t = e.begin,
                  i = e.end,
                  n = this.selection.selInfo.getSelectionInfo(),
                  a = t.position > i.position,
                  s = { isSend: !0, isChangedByFuncKeys: !0 };
                if (n.inTable)
                  if (this._isIncompleteCellRange(n)) {
                    var r = _.movePreviousPosition(this.data, i);
                    null !== r && i.position === r && (r = null),
                      this._extendSelectionInSingleCell(r, !1);
                  } else {
                    if (this._isCompleteSingleCellRange(n) && !a)
                      return void this._restorePosition(t);
                    var c = this._getRelatedCell(i.position, n),
                      d = this._getRelatedCell(t.position, n);
                    if (!c || !d) return;
                    var h = c.begin,
                      p = this.data.doc.getBodyRange(h).begin,
                      u = _.movePreviousPosition(
                        this.data,
                        new P.a(this.selection, h)
                      ),
                      f = u;
                    if (
                      (((null === u && h === p) || u === h) &&
                        ((u = h), (f = -1)),
                      null !== u)
                    ) {
                      var g = this._getPositionInfo(h, u, f);
                      if (g.isAcrossHorizontalBound) return this.moveUp();
                      if (g.isAcrossVerticalBound)
                        return n.rowSelected
                          ? void (
                              null !== u &&
                              this.selection.setPosition(
                                this.selection.begin.position,
                                u,
                                s
                              )
                            )
                          : (this._saveCachedSelectionInfo({
                              isSaveRanges: !0,
                            }),
                            void this._extendSelectionInRows(!0, c, d));
                      var v = void 0,
                        y = void 0;
                      if (u >= d.end) {
                        var T = a ? [u + 1, d.begin] : [d.begin, u + 1],
                          S = o()(T, 2);
                        (v = S[0]), (y = S[1]);
                      } else {
                        var x = a ? [d.end, u] : [u, d.end],
                          b = o()(x, 2);
                        (v = b[0]), (y = b[1]);
                      }
                      this.selection.setPosition(v, y, s);
                    }
                  }
                else {
                  var C = _.movePreviousPosition(this.data, i);
                  if (null !== C) {
                    if (
                      Object(E.isInSameTable)(this.data.doc, t.position, C) &&
                      this._restoreSelectionRanges()
                    )
                      return;
                    var L = this._revertTableLineRange(!1, a);
                    (C = Number.isInteger(L) ? L : C),
                      this.selection.setPosition(
                        t,
                        new P.a(this.selection, C),
                        l()({}, s, { isClick: !0 })
                      );
                  }
                }
              },
            },
            {
              key: "moveRight",
              value: function () {
                var e = this.selection,
                  t = e.begin,
                  i = e.end,
                  n = this.selection.selInfo.getSelectionInfo(),
                  a = t.position > i.position,
                  s = { isSend: !0, isChangedByFuncKeys: !0 };
                if (n.inTable)
                  if (this._isIncompleteCellRange(n)) {
                    var r = _.moveNextPosition(this.data, i);
                    this._extendSelectionInSingleCell(r, !0);
                  } else {
                    if (this._isCompleteSingleCellRange(n) && a)
                      return void this._restorePosition(i);
                    var c = this._getRelatedCell(i.position, n),
                      d = this._getRelatedCell(t.position, n);
                    if (!c || !d) return;
                    var h = c.end - 1,
                      p = _.moveNextPosition(
                        this.data,
                        new P.a(this.selection, h)
                      );
                    if (null !== p) {
                      var u = this._getPositionInfo(h, p, p + 1);
                      if (u.isAcrossHorizontalBound) return this.moveDown();
                      if (u.isAcrossVerticalBound)
                        return n.rowSelected
                          ? void this.selection.setPosition(
                              this.selection.begin.position,
                              p + 2,
                              s
                            )
                          : (this._saveCachedSelectionInfo({
                              isSaveRanges: !0,
                            }),
                            void this._extendSelectionInRows(!1, c, d));
                      var f = void 0,
                        g = void 0;
                      if (p >= d.end) {
                        var v = a ? [p + 1, d.begin] : [d.begin, p + 1],
                          y = o()(v, 2);
                        (f = y[0]), (g = y[1]);
                      } else {
                        var T = a ? [d.end, p] : [p, d.end],
                          S = o()(T, 2);
                        (f = S[0]), (g = S[1]);
                      }
                      this.selection.setPosition(f, g, s);
                    }
                  }
                else {
                  var x = _.moveNextPosition(this.data, i);
                  if (null !== x) {
                    if (
                      Object(E.isInSameTable)(this.data.doc, t.position, x) &&
                      this._restoreSelectionRanges()
                    )
                      return;
                    var b = this._revertTableLineRange(!0, a);
                    x = Number.isInteger(b) ? b : x;
                    var C = t && i && i.position >= t.position;
                    if (x === t.position) {
                      var L = this.data.doc.getLimitedRange(i.position),
                        m = L.pos + L.len,
                        I = i.position === m ? m : null;
                      x === i.position &&
                        i.position === t.position &&
                        L.pos + L.len !== I &&
                        (I = m),
                        this.selection.setPosition(
                          t.position,
                          I,
                          l()({}, s, { isClick: !0 })
                        );
                    } else
                      this.selection.setPosition(
                        t,
                        new P.a(this.selection, x, C),
                        l()({}, s, { isClick: !0 })
                      );
                  }
                }
              },
            },
            {
              key: "moveUp",
              value: function () {
                var e = this.selection,
                  t = e.begin,
                  i = e.end,
                  n = this.selection.selInfo.getSelectionInfo(),
                  a = t.position > i.position,
                  s = { isSend: !0, isChangedByFuncKeys: !0 };
                if (n.inTable)
                  if (this._isIncompleteCellRange(n)) {
                    var r = _.moveUpPosition(this.data, i);
                    this._extendSelectionInSingleCell(r && r.position, !1);
                  } else {
                    if (this._isCompleteSingleCellRange(n) && !a)
                      return void this._restorePosition(t);
                    var c = this._getRelatedCell(i.position, n),
                      d = this._getRelatedCell(t.position, n);
                    if (!c || !d) return;
                    var h = c.begin,
                      p = _.moveUpPosition(
                        this.data,
                        new P.a(this.selection, h)
                      ),
                      u = p && p.position;
                    if ((null === p && ((p = h), (u = -1)), null !== p)) {
                      if (
                        this._getPositionInfo(h, p.position, u)
                          .isAcrossVerticalBound
                      ) {
                        if (n.rowSelected) {
                          if (a) {
                            var f = isNaN(
                              this.cachedSelectionInfo.innerTablePos
                            )
                              ? i.position
                              : this.cachedSelectionInfo.innerTablePos;
                            null !==
                              (p = _.moveUpPosition(
                                this.data,
                                new P.a(this.selection, f)
                              )) &&
                              p.position <= i.position &&
                              this.selection.setPosition(
                                this.selection.begin.position,
                                p.position,
                                s
                              );
                          } else this._restorePosition(t.position);
                          return;
                        }
                        return (
                          this._saveCachedSelectionInfo({
                            innerTablePos: c.begin,
                            isSaveRanges: !0,
                          }),
                          void this._extendSelectionInRows(!0, c, d)
                        );
                      }
                      var g = void 0,
                        v = void 0;
                      if (p.position >= d.end) {
                        var y = a
                            ? [p.position + 1, d.begin]
                            : [d.begin, p.position + 1],
                          T = o()(y, 2);
                        (g = T[0]), (v = T[1]);
                      } else {
                        var S =
                            p.position < d.begin
                              ? [d.end, p.position]
                              : [p.position, d.end],
                          x = o()(S, 2);
                        (g = x[0]), (v = x[1]);
                      }
                      this.selection.setPosition(g, v, s);
                    }
                    delete this.cachedSelectionInfo.innerTablePos;
                  }
                else {
                  var b = _.moveUpPosition(this.data, i);
                  if (null !== b) {
                    if (
                      Object(E.isInSameTable)(
                        this.data.doc,
                        t.position,
                        b.position
                      ) &&
                      this._restoreSelectionRanges()
                    )
                      return;
                    var C = this._revertTableLineRange(!1, a);
                    if (
                      void 0 !== (b = Number.isInteger(C) ? C : b).isInFooter
                    ) {
                      var L = this.data.doc.getLimitedRange(i.position);
                      (b.position < L.pos ||
                        L.pos + L.len < b.position ||
                        b.layoutIndex !== t.pos.layoutIndex) &&
                        (b = new P.a(this.selection, L.pos, !1));
                    }
                    this._handleShift(b, !0);
                  } else {
                    var m = i.pos.line.range;
                    t.position === m.begin
                      ? this.selection.setPosition(
                          t,
                          null,
                          l()({}, s, { activateCtrl: !0, isClick: !0 })
                        )
                      : this.selection.setPosition(
                          t.position,
                          m.begin,
                          l()({}, s, { activateCtrl: !0, isClick: !0 })
                        );
                  }
                }
              },
            },
            {
              key: "moveDown",
              value: function () {
                var e = this.selection,
                  t = e.begin,
                  i = e.end,
                  n = this.selection.selInfo.getSelectionInfo(),
                  a = t.position > i.position,
                  s = { isSend: !0, isChangedByFuncKeys: !0 };
                if (n.inTable)
                  if (this._isIncompleteCellRange(n)) {
                    var r = _.moveDownPosition(this.data, i);
                    this._extendSelectionInSingleCell(r && r.position, !0);
                  } else {
                    if (this._isCompleteSingleCellRange(n) && a)
                      return void this._restorePosition(i);
                    var c = this._getRelatedCell(i.position, n),
                      d = this._getRelatedCell(t.position, n);
                    if (!c || !d) return;
                    var h = c.end - 1,
                      p = _.moveDownPosition(
                        this.data,
                        new P.a(this.selection, h)
                      );
                    if (null !== p) {
                      if (
                        this._getPositionInfo(h, p.position, p.position)
                          .isAcrossVerticalBound
                      ) {
                        if (n.rowSelected) {
                          if (a) this._restorePosition(t.position - 2);
                          else {
                            var u = isNaN(
                              this.cachedSelectionInfo.innerTablePos
                            )
                              ? i.position - 1
                              : this.cachedSelectionInfo.innerTablePos;
                            (p = _.moveDownPosition(
                              this.data,
                              new P.a(this.selection, u)
                            )),
                              this.selection.setPosition(
                                this.selection.begin.position,
                                p.position + 1,
                                s
                              );
                          }
                          return;
                        }
                        return (
                          this._saveCachedSelectionInfo({
                            innerTablePos: c.end - 1,
                            isSaveRanges: !0,
                          }),
                          void this._extendSelectionInRows(!1, c, d)
                        );
                      }
                      var f = void 0,
                        g = void 0;
                      if (p.position >= d.end) {
                        var v =
                            p.position < d.begin
                              ? [p.position + 1, d.begin]
                              : [d.begin, p.position + 1],
                          y = o()(v, 2);
                        (f = y[0]), (g = y[1]);
                      } else {
                        var T = a ? [d.end, p.position] : [p.position, d.end],
                          S = o()(T, 2);
                        (f = S[0]), (g = S[1]);
                      }
                      this.selection.setPosition(f, g, s);
                    }
                    delete this.cachedSelectionInfo.innerTablePos;
                  }
                else {
                  var x = _.moveDownPosition(this.data, i);
                  if (null !== x) {
                    if (
                      Object(E.isInSameTable)(
                        this.data.doc,
                        t.position - 1,
                        x.position
                      ) &&
                      this._restoreSelectionRanges()
                    )
                      return;
                    var b = this._revertTableLineRange(!0, a);
                    if (
                      void 0 !== (x = Number.isInteger(b) ? b : x).isInFooter
                    ) {
                      var C = this.data.doc.getLimitedRange(i.position);
                      (x.position < C.pos ||
                        C.pos + C.len <= x.position ||
                        x.layoutIndex !== t.pos.layoutIndex) &&
                        (x = new P.a(this.selection, C.pos + C.len - 1, !1));
                    }
                    this._handleShift(x, !0);
                  } else {
                    var L = i.pos.line.range;
                    t.position === L.end
                      ? this.selection.setPosition(
                          t,
                          null,
                          l()({}, s, { activateCtrl: !0, isClick: !0 })
                        )
                      : this.selection.setPosition(
                          t,
                          L.end,
                          l()({}, s, { activateCtrl: !0, isClick: !0 })
                        );
                  }
                }
              },
            },
            {
              key: "_isInFooter",
              value: function (e) {
                return e && void 0 !== e.isInFooter;
              },
            },
            {
              key: "_isFirstLine",
              value: function (e) {
                return (
                  1 === e.pageNo &&
                  1 === e.rowOfTextPage &&
                  void 0 === e.isInFooter
                );
              },
            },
            {
              key: "_isLastLine",
              value: function (e) {
                var t = e;
                Number.isInteger(t) && (t = new P.a(this.selection, t));
                var i = t.pos.line.range,
                  n = i.pos,
                  o = i.len,
                  a = this.data.doc.getLimitedRange(t.position),
                  s = a.pos,
                  r = s + a.len;
                return n + o === r && s <= n && n <= r ? r : -1;
              },
            },
            {
              key: "_isDiffFooterRange",
              value: function (e, t) {
                var i = e.pageNo,
                  n = e.pageIndex,
                  o = new P.a(this.selection, t),
                  a = o.pageNo,
                  s = o.pageIndex;
                return (
                  void 0 !== e.isInFooter &&
                  (e.isInFooter !== o.isInFooter ||
                    (a && i !== a) ||
                    (s && n !== s))
                );
              },
            },
            {
              key: "_tryTimes",
              value: function (e, t, i, n, o) {
                for (
                  var a = !1,
                    s = null,
                    r = e.pos,
                    l = r.posX,
                    c = r.posY,
                    d = 1;
                  d < i && !0 !== a;
                  d++
                )
                  if (
                    (s = u.a.hit(
                      this.data,
                      { x: l, y: c + t * d * n },
                      this.data.typoinfo
                    ))
                  ) {
                    var h = s.position;
                    o && s.lineBreakHit && 1 === n && (h += 1),
                      h !== e.position && (a = !0);
                  }
                return (
                  (null !== s && !1 !== s) ||
                    (s = T.default.hit(
                      this.data,
                      { x: l + n, y: c + t },
                      this.data.typoinfo
                    )),
                  (null !== s && !1 !== s) || (s = e.position + n),
                  s
                );
              },
            },
            {
              key: "_handleShift",
              value: function (e, t) {
                var i = this.selection.begin,
                  n = i.position,
                  o = { isSend: !0, activateCtrl: !0, isChangedByFuncKeys: !0 };
                !0 === t
                  ? Number.isInteger(n) && Number.isInteger(e) && n === e
                    ? this.selection.setPosition(i, null, o)
                    : this.selection.setPosition(i, e, o)
                  : this.selection.setPosition(e, e, o);
              },
            },
            {
              key: "toLineStart",
              value: function (e) {
                this.selection.clearCache();
                var t = this.selection,
                  i = t.begin,
                  n = t.end,
                  o = (i.position < n.position ? i : n).pos.line.range.pos,
                  a = T.default.locate(
                    this.data,
                    o,
                    !1,
                    this.data.typoinfo,
                    "lineHome"
                  );
                this._handleShift(a, e);
              },
            },
            {
              key: "toLineEnd",
              value: function (e) {
                this.selection.clearCache();
                var t = this.selection,
                  i = t.begin,
                  n = t.end,
                  o = (i.position > n.position ? i : n).pos.line.range,
                  a = o.pos + o.len,
                  s = !0;
                if (!e) {
                  var r = this.data.doc.textStream.getPapxTbl(),
                    l = r.fetchHintContainPos(
                      r.HintVT.it_hint1,
                      a > 0 ? a - 1 : a
                    ).end;
                  !isNaN(l) && l === a && (--a, (s = !1));
                }
                var c = T.default.locate(
                  this.data,
                  a,
                  s,
                  this.data.typoinfo,
                  "lineEnd"
                );
                this._handleShift(c, e);
              },
            },
            {
              key: "toPageStart",
              value: function (e) {
                var t = this;
                if (!e && this.isRestrictEditMode) {
                  var i = this.formatContentController.move2FirstController();
                  i &&
                    Object(C.typoToPositionWithLoading)(i.end).then(
                      function () {
                        t.selection.setPosition(i.begin, i.end, {
                          isSend: !0,
                          isChangedByFuncKeys: !0,
                        }),
                          window.APP.workspace.makesureCursorVisible(!0);
                      },
                      function () {}
                    );
                } else {
                  var n = this.selection.begin,
                    o = this.data.doc.getLimitedRange(n.position);
                  Object(C.typoToPositionWithLoading)(o.pos).then(
                    function () {
                      t._handleShift(new P.a(t.selection, o.pos, !1), e),
                        window.APP.workspace.makesureCursorVisible(e);
                    },
                    function () {}
                  );
                }
              },
            },
            {
              key: "toPageEnd",
              value: function (e) {
                var t = this;
                if (!e && this.isRestrictEditMode) {
                  var i = this.formatContentController.move2LastController();
                  i &&
                    Object(C.typoToPositionWithLoading)(i.end).then(
                      function () {
                        t.selection.setPosition(i.begin, i.end, {
                          isSend: !0,
                          isChangedByFuncKeys: !0,
                        }),
                          window.APP.workspace.makesureCursorVisible(!0);
                      },
                      function () {}
                    );
                } else {
                  var n = this.selection.end,
                    o = this.data.doc.getLimitedRange(n.position),
                    a = o.pos + o.len - 1;
                  Object(C.typoToPositionWithLoading)(a).then(
                    function () {
                      t._handleShift(a, e),
                        window.APP.workspace.makesureCursorVisible(e);
                    },
                    function () {}
                  );
                }
              },
            },
            {
              key: "pageUpPosition",
              value: function (e) {
                var t = this.selection,
                  i = t.begin,
                  n = t.end,
                  o = n.pos,
                  a = o.posX,
                  s = o.posY,
                  r = o.line,
                  l = window.APP.workspace.config.zoom || 1,
                  c = r.baseline,
                  d = window.APP.workspace._workspace.clientWidth,
                  h = window.APP.workspace._workspace.clientHeight / l,
                  p = s - h + c,
                  f = !1,
                  g = u.a.hit(this.data, { x: a, y: p }, this.data.typoinfo);
                if (!g) {
                  var v = this.selection.data.typoinfo
                    .calcRects()
                    .findIndex(function (e) {
                      return p < e.top;
                    });
                  v > 0 &&
                    (window.APP.view.updater.updatePages({
                      from: v - 1,
                      to: v - 1,
                    }),
                    (g = u.a.hit(
                      this.data,
                      { x: a, y: p },
                      this.data.typoinfo
                    )));
                }
                if (this._isDiffFooterRange(n, g)) {
                  var y = this.data.doc.getLimitedRange(n.position);
                  return (
                    this._handleShift(new P.a(this.selection, y.pos, !1), e), !0
                  );
                }
                if (!1 !== g && n.position !== g.position) {
                  f = !0;
                  var _ = i.position;
                  if (e && this.data.doc.textboxs.isInTextbox(_)) {
                    var T = g.position,
                      E = this.data.doc.getLimitedRange(_);
                    (T < E.pos || T > E.pos + E.len) && (T = E.pos),
                      this._handleShift(T, e);
                  } else this._handleShift(g, e);
                } else if (this._isFirstLine(n))
                  0 !== n.position && ((f = !0), this._handleShift(0, e));
                else if (((f = !0), !1 === n.isInFooter)) {
                  var S = u.a.hit(
                    this.data,
                    { x: a - d, y: s },
                    this.data.typoinfo
                  );
                  this._handleShift(S, e);
                } else if (this._isInFooter(n)) f = !0;
                else {
                  var x = this._tryTimes(n, -h, 10, -1, e);
                  (f = !0), this._handleShift(x, e);
                }
                return f;
              },
            },
            {
              key: "pageDownPosition",
              value: function (e) {
                var t = this.selection,
                  i = t.begin,
                  n = t.end,
                  o = n.pos,
                  a = o.posX,
                  s = o.posY,
                  r = window.APP.workspace.config.zoom || 1,
                  l = window.APP.workspace._workspace.clientHeight / r,
                  c = s + l,
                  d = !1,
                  h = u.a.hit(this.data, { x: a, y: c }, this.data.typoinfo);
                if (!h) {
                  var p = this.selection.data.typoinfo
                    .calcRects()
                    .findIndex(function (e) {
                      return c < e.top;
                    });
                  p > 0 &&
                    (window.APP.view.updater.updatePages({
                      from: p - 1,
                      to: p - 1,
                    }),
                    (h = u.a.hit(
                      this.data,
                      { x: a, y: c },
                      this.data.typoinfo
                    )));
                }
                if (this._isDiffFooterRange(n, h)) {
                  var f = this.data.doc.getLimitedRange(n.position),
                    g = new P.a(this.selection, f.pos + f.len - 1);
                  return (
                    n.position !== g.position && this._handleShift(g, e), !0
                  );
                }
                var v = !1,
                  y = void 0;
                if (
                  (h &&
                    ((y = h.position),
                    e && h.lineBreakHit && (y += 1),
                    n.position !== y && (v = !0)),
                  v)
                ) {
                  d = !0;
                  var _ = i.position;
                  if (e && this.data.doc.textboxs.isInTextbox(_)) {
                    var T = h.position,
                      E = this.data.doc.getLimitedRange(_);
                    (T < E.pos || T > E.pos + E.len) && (T = E.pos + E.len),
                      this._handleShift(T, e);
                  } else this._handleShift(h, e);
                } else {
                  var S = this._isLastLine(n);
                  if (-1 !== S)
                    this.selection.clearCache(),
                      n.position !== S &&
                        n.position !== S - 1 &&
                        ((d = !0), this._handleShift(S - 1, e));
                  else if (this._isInFooter(n)) d = !0;
                  else {
                    var x = this._tryTimes(n, l, 10, 1, e);
                    (d = !0), this._handleShift(x, e);
                  }
                }
                return d;
              },
            },
            {
              key: "selectRevision",
              value: function (e) {
                (this.selection.activeRevision = e),
                  L.default.dispatchEvent(
                    L.default.names.DOC_SELECTION_CHANGED,
                    {}
                  );
              },
            },
            {
              key: "formatContentController",
              get: function () {
                return window.APP.formatContentController;
              },
            },
            {
              key: "isRestrictEditMode",
              get: function () {
                return this.formatContentController.isRestrictEditMode;
              },
            },
          ]),
          e
        );
      })();
      t.default = H;
    },
    1955: function (e, t, i) {
      "use strict";
      i.r(t),
        i.d(t, "TABLE_HOTSPOT_UNIT", function () {
          return n;
        }),
        i.d(t, "TABLE_HIGHLIGHT_TYPE", function () {
          return o;
        }),
        i.d(t, "TABLE_INSERT_TYPE", function () {
          return a;
        }),
        i.d(t, "TABLE_DELETE_TYPE", function () {
          return s;
        }),
        i.d(t, "TABLE_CELL_OPTIONS", function () {
          return r;
        }),
        i.d(t, "TABLE_SELECT_MODE", function () {
          return l;
        }),
        i.d(t, "TABLE_COLUMN_ROW_ADJUST_MODE", function () {
          return c;
        }),
        i.d(t, "TABLE_BORDER_STYLE", function () {
          return d;
        }),
        i.d(t, "TABLE_THEME_COLOR", function () {
          return h;
        }),
        i.d(t, "TABLE_ROW_HEADER_TYPE", function () {
          return p;
        }),
        i.d(t, "TABLE_DASHED_BORDER_TYPE", function () {
          return u;
        }),
        i.d(t, "TABLE_AUTO_ADJUST", function () {
          return f;
        }),
        i.d(t, "TABLE_ROW_HEIGHT_COL_WIDTH", function () {
          return g;
        }),
        i.d(t, "TABLE_COLUMN_MIN_WIDTH", function () {
          return v;
        }),
        i.d(t, "TABLE_HIDDEN_TIMEOUT", function () {
          return y;
        }),
        i.d(t, "TABLE_RESIZE_HIGHLIGHT_TIMEOUT", function () {
          return _;
        }),
        i.d(t, "TABLE_ADJUST_HIGHLIGHT_TIMEOUT", function () {
          return P;
        }),
        i.d(t, "TABLE_FOCUS_TABLE_TIMEOUT", function () {
          return T;
        }),
        i.d(t, "TABLE_HOVER_ADD_BTN_TIMEOUT", function () {
          return E;
        });
      var n = {
          BORDER: 4,
          PADDING: 4,
          MARGIN: 10,
          DIFF: 5,
          OVERLAY: 20,
          SCROLLERHEIGHT: 20,
        },
        o = { TABLE: "TABLE", COLUMN: "COLUMN", ROW: "ROW" },
        a = {
          ROW_TOP: "ROW_INSERT_TOP",
          ROW_BOTTOM: "ROW_INSERT_BOTTOM",
          COLUMN_LEFT: "COLUMN_INSERT_LEFT",
          COLUMN_RIGHT: "COLUMN_INSERT_RIGHT",
        },
        s = {
          ROW: "DELETE_ROW",
          COLUMN: "DELETE_COLUMN",
          TABLE: "DELETE_TABLE",
        },
        r = {
          MERGE: "MERGE_CELLS",
          SPLIT: "SPLIT_CELLS",
          VERT_HORZ_CENTER: "VERT_HORZ_CENTER",
        },
        l = { NONE: "NONE", CELL: "CELL", ROW: "ROW", COLUMN: "COLUMN" },
        c = { ADJUST_WIN: 0, AVERAGE_ROW: 1, AVERAGE_COLUMN: 2 },
        d = {
          DEFAULT: 0,
          FULL_LINE: 1,
          FULL_FILL: 2,
          TOP_COLUMN: 3,
          COLUMN_ROW_FILL: 4,
        },
        h = { DEFAULT: 0, BLUE: 1, GREEN: 2, DARK: 3, YELLOW: 4, PURPLE: 5 },
        p = {
          SET: "SET_TABLE_ROW_HEADER_DUPLICATE",
          CANCEL: "CANCEL_TABLE_ROW_HEADER_DUPLICATE",
        },
        u = {
          SHOW: "SHOW_TABLE_DASHED_BORDER",
          HIDE: "HIDE_TABLE_DASHED_BORDER",
        },
        f = {
          DISABLED: "TABLE_AUTO_ADJUST_DISABLED",
          ADJUST_WIN: "TABLE_AUTO_ADJUST_WIN",
          AVERAGE_ROW: "TABLE_AUTO_ADJUST_AVERAGE_ROW",
          AVERAGE_COL: "TABLE_AUTO_ADJUST_AVERAGE_COL",
        },
        g = { ROW_HEIGHT: "TABLE_ROW_HEIGHT", COL_WIDTH: "TABLE_COL_WIDTH" },
        v = 16,
        y = 1e3,
        _ = 500,
        P = 500,
        T = 100,
        E = 300;
    },
    3495: function (e, t, i) {
      "use strict";
      var n = i(1),
        o = i.n(n),
        a = i(2),
        s = i.n(a),
        r = i(62),
        l = i.n(r),
        c = i(281),
        d = i(345),
        h = i(361),
        p = i(315),
        u = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hit",
                value: function (t, i, n, o, a) {
                  a.enter(n);
                  var s = e.hitCell(t, i, n, o, a);
                  return a.exit(), s;
                },
              },
              {
                key: "hitCell",
                value: function (e, t, i, n, o) {
                  var a = h.default.initWithOrigin({
                    x:
                      t.x - ((i.cell2page_offset && i.cell2page_offset.x) || 0),
                    y:
                      t.y - ((i.cell2page_offset && i.cell2page_offset.y) || 0),
                  });
                  if (
                    i.is_diag_cell &&
                    i.diagCell.pages.length &&
                    this._hitDiagCell(e, a, i, n, o)
                  )
                    return !0;
                  if (!i.cell_page) {
                    for (var s = i.parent.prev; s && s.isInTable; ) {
                      var r = s.tablecells[i.index];
                      if (r.cell_page) {
                        for (
                          var l = h.default.initWithOrigin({
                              x:
                                t.x -
                                ((r.cell2page_offset && r.cell2page_offset.x) ||
                                  0),
                              y:
                                t.y -
                                ((r.cell2page_offset && r.cell2page_offset.y) ||
                                  0),
                            }),
                            c = r,
                            d = [],
                            p = o.node_chain.length;
                          p > 0;
                          p--
                        )
                          o.exit(),
                            d.unshift(c),
                            (c = c.parent || c.outer.host);
                        return (
                          d.forEach(function (e) {
                            o.enter(e);
                          }),
                          B.hit(e, l, r.cell_page, n, o)
                        );
                      }
                      s = s.prev;
                    }
                    return !1;
                  }
                  return !!B.hit(e, a, i.cell_page, n, o);
                },
              },
              {
                key: "_hitDiagCell",
                value: function (e, t, i, n, o) {
                  if (i.is_diag_cell && i.diagCell.pages.length) {
                    var a = [];
                    i.diagCell.pages.forEach(function (e) {
                      var t = { x: e.rect.left, y: e.rect.top };
                      e.lines.forEach(function (e) {
                        (e.sublines && e.sublines.length
                          ? e.sublines
                          : [e]
                        ).forEach(function (e) {
                          a.push({
                            line: e,
                            rect: d.default.getRectByRectAndOffset(e.rect, t),
                          });
                        });
                      });
                    });
                    for (
                      var s = Number.MAX_SAFE_INTEGER, r = -1, l = 0;
                      l < a.length;
                      ++l
                    ) {
                      var c = a[l].rect,
                        h = d.default.distanceFromPointToRect(t, c);
                      if (h < s && ((r = l), (s = h) <= 0)) break;
                    }
                    if (-1 == r) return !1;
                    var u = a[r].line,
                      f =
                        u.parent.layoutType === p.DOCLayoutType.CellPage
                          ? u.parent
                          : u.parent.parent;
                    return !!B.hit(e, t, f, n, o);
                  }
                },
              },
            ]),
            e
          );
        })(),
        f = i(371),
        g = i(1194),
        v = i(3586),
        y = i(290),
        _ = i(716),
        P = i(770),
        T = i(4968),
        E = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hit",
                value: function (t, i, n, o, a, s) {
                  s.enter(n);
                  var r = e.hitLine(t, i, n, o, a, s);
                  return s.exit(), r;
                },
              },
              {
                key: "getCoorPos2Worspace",
                value: function (e, t) {
                  for (
                    var i = e.getCoorPos2Worspace(),
                      n = i.x,
                      o = i.y,
                      a = t.parent;
                    a && !a.isChildShape;

                  )
                    a = a.parent;
                  if (a) {
                    var s = a.rect2TopShape;
                    (n += s.left), (o += s.top);
                  }
                  return { x: n, y: o };
                },
              },
              {
                key: "hitLine",
                value: function (t, i, n, o, a, s) {
                  var r = null;
                  a.innerPos = { x: i.x, y: i.y };
                  var d = e.getCoorPos2Worspace(s, n),
                    p = d.x,
                    u = d.y;
                  if (
                    ((a.coorPos2View = { x: p, y: u }),
                    n.auto_num &&
                      (h.default.add(
                        s.position,
                        n.position2parent,
                        n.offset4child
                      ),
                      (r = n.glyphGroupInfos)),
                    n.tablecells)
                  ) {
                    var E = h.default.initWithOrigin({
                      x: i.x - n.position2parent.x,
                      y: i.y - n.position2parent.y,
                    });
                    return e.tablecellsHit(t, E, n.tablecells, a, s);
                  }
                  if (n.sublines)
                    return e.sublinesHit(t, i, n.sublines, o, a, s);
                  n.auto_num ||
                    (h.default.add(
                      s.position,
                      n.position2parent,
                      n.offset4child
                    ),
                    (r = n.glyphGroupInfos));
                  var S = e.getCoorPos2Worspace(s, n);
                  if (
                    ((a.isFuzzyHit = !1),
                    (a.glyphTail = !1),
                    (a.lineBreakHit = !1),
                    !r || r.length <= 0)
                  )
                    return (
                      Object.assign(a, {
                        glyphTail: !0,
                        isLineLastChar: !0,
                        halfOfRight: !0,
                        position: 0,
                        charWidth: 0,
                        height: 0,
                        posX: 0,
                        posY: 0,
                        charPosY: 0,
                        charHeight: 0,
                        line: n,
                      }),
                      !0
                    );
                  var x = i.x,
                    b = -1,
                    C = 0,
                    L = 0,
                    m = t.glyphpool.glyphBuff,
                    I = function (e) {
                      var t = e.endOffset + n.range.pos - 1;
                      return !!f.default.isLineBreak(m.getCharCode(t));
                    };
                  if (
                    0 ===
                    (r = r
                      .filter(function (e) {
                        return (
                          !(!e.isVisible() && !e.oMath) ||
                          f.default.isControl(
                            m.getCharCode(e.beginOffset + n.range.pos)
                          )
                        );
                      })
                      .sort(function (e, t) {
                        return e.x + e.widthSum / 2 - (t.x + t.widthSum / 2);
                      })).length
                  )
                    try {
                      var R = n.range.begin,
                        w = t.typoinfo.getPosition(R).pos;
                      return (
                        Object.assign(a, {
                          glyphTail: !0,
                          isLineLastChar: !0,
                          halfOfRight: !0,
                          position: w.position,
                          charWidth: w.charWidth,
                          height: w.height,
                          posX: w.posX,
                          posY: w.posY,
                          charPosY: w.charPosY,
                          charHeight: w.charHeight,
                          line: w.line,
                        }),
                        !0
                      );
                    } catch (e) {
                      return !1;
                    }
                  var A = !1;
                  if (x < r[0].x) {
                    var H = r[0];
                    H.isLayoutRTL
                      ? (I(H)
                          ? ((a.lineBreakHit = !0), (b = 0))
                          : ((a.glyphTail = !0), (b = H.widths.length)),
                        (L = H.x))
                      : (A = !0);
                  } else {
                    var k = r.length - 1,
                      O = r[k];
                    if (x >= O.x + O.widthSum)
                      O.isLayoutRTL
                        ? (A = !0)
                        : I(O)
                        ? ((a.lineBreakHit = !0), (b = 0), (L = O.x))
                        : ((b = O.widths.length),
                          (a.glyphTail = !0),
                          (L = O.x + O.widthSum)),
                        (C = k);
                    else {
                      for (var F = 0, D = r.length; F < D; ) {
                        var B = (F + D) >> 1,
                          N = r[B],
                          M = N.x;
                        if (x < M) D = B;
                        else {
                          if (!(x > M + N.widthSum)) {
                            C = B;
                            break;
                          }
                          F = B + 1;
                        }
                      }
                      var U = r[C];
                      if (U.zone.type === _.ZoneType.TwoLinesInOne) {
                        var G = U.zone;
                        if (G.secondLine) {
                          var W = (
                            i.y <= G.getFirstLineBottom()
                              ? G.firstLine.glyphGroupInfos
                              : G.secondLine.glyphGroupInfos
                          ).find(function (e) {
                            return e.x <= x && x <= e.x + e.widthSum;
                          });
                          void 0 !== W &&
                            W !== U &&
                            (C = r.findIndex(function (e) {
                              return e === W;
                            }));
                        }
                      }
                    }
                  }
                  if (!a.lineBreakHit && !a.glyphTail) {
                    var z = r[C],
                      Y = z.widths,
                      X = Y.length;
                    if (z.oMath) {
                      var j = z.oMath.hit(
                        x - z.x,
                        i.y - (z.y + n.baseline - z.oMath.baseline)
                      );
                      b = j.posOffset;
                    } else if (Object(T.a)(z)) {
                      var K = z.x,
                        J = z.widthSum;
                      x < K + J && x > K + J / 2
                        ? ((b = 1), (L = K + J), (a.glyphTail = !0))
                        : ((b = 0), (L = K));
                    } else if (z.isLayoutRTL) {
                      var V = z.x + z.widthSum;
                      for (b = 0; b < X; ++b) {
                        var Z = Y[b];
                        if (x > V - Z) {
                          x <= V - Z / 2
                            ? (++b, (a.glyphTail = !0), (L = V - Z))
                            : (L = V);
                          break;
                        }
                        V -= Z;
                      }
                    } else if (z.zone.isEqZone) {
                      var $ = Y[Y.length - 1];
                      x < z.x + $ / 2
                        ? ((b = 0), (L = z.x))
                        : ((b = Y.length),
                          (L = z.x + z.widthSum),
                          (a.glyphTail = !0));
                    } else {
                      var Q = z.x;
                      for (b = 0; b < X; ++b) {
                        var q = Y[b];
                        if (x < Q + q) {
                          x > Q + q / 2
                            ? (++b, (a.glyphTail = !0), (L = Q + q))
                            : (L = Q),
                            x >= Q &&
                              i.y >= z.y &&
                              i.y <= z.y + n.baseline &&
                              z.isTickCharBox() &&
                              ((a.isHitOnBox = !0),
                              (a.isTickCharSymbol = z.isTickCharSymbol()));
                          break;
                        }
                        L = Q += q;
                      }
                    }
                  }
                  var ee = void 0,
                    te = void 0,
                    ie = void 0;
                  if (A && a.glyphTail) {
                    (a.isLineLastChar = !0),
                      (a.position = n.range.pos + n.range.len),
                      (a.charWidth = 0),
                      (a.height = n.rect.bottom - n.rect.top);
                    var ne = r[C];
                    (ee = ne.isLayoutRTL ? ne.x : ne.x + ne.widthSum),
                      (te = ne.y);
                    var oe =
                        (ne.zone.getDrawBaseline &&
                          ne.zone.getDrawBaseline(n.baseline, ne)) ||
                        n.baseline,
                      ae = ne.metrics,
                      se = ne.y + oe - ae.ascent;
                    (ie = Math.max(te, se)),
                      (a.charHeight = Math.max(
                        0,
                        Math.min(se + ae.height - ie, te + a.height - ie)
                      )),
                      (a.line = n),
                      i.x > ne.x + ne.widthSum && (a.isFuzzyHit = !0);
                  } else {
                    var re = r[C],
                      le = void 0,
                      ce = void 0,
                      de = void 0,
                      he = function () {
                        var e = re.beginOffset + b,
                          i = r.findIndex(function (t) {
                            return (
                              t.beginOffset <= e &&
                              e < t.beginOffset + t.widths.length
                            );
                          });
                        -1 !== i && (C = i);
                        var o = n.range.pos + e;
                        if (
                          ((ce = f.default.isControlBegin(m.getCharCode(o))),
                          (de = f.default.isControlEnd(m.getCharCode(o - 1))),
                          (a.glyphTail &&
                            f.default.isEmbedDrawing(m.getCharCode(o - 1))) ||
                            (!a.glyphTail &&
                              f.default.isEmbedDrawing(m.getCharCode(o))))
                        )
                          return "break";
                        var s = void 0;
                        if (
                          (ce ||
                            de ||
                            (f.default.isLineBreak(m.getCharCode(o)) &&
                              (re.isLayoutRTL
                                ? (s = r[C + 1]) &&
                                  s.isLayoutRTL &&
                                  (de = f.default.isControlEnd(
                                    m.getCharCode(s.beginOffset + n.range.pos)
                                  ))
                                : (s = r[C - 1]) &&
                                  !s.isLayoutRTL &&
                                  (de = f.default.isControlEnd(
                                    m.getCharCode(s.beginOffset + n.range.pos)
                                  )))),
                          ce)
                        ) {
                          var c = t.doc.contentControls
                              .collect(o, 1)
                              .sort(function (e, t) {
                                return e.len - t.len;
                              }),
                            d = l()(c, 1)[0];
                          if (d && d.isDate) return "break";
                          if (re.oMath) return "break";
                          var h = re.isLayoutRTL ? C - 1 : C + 1;
                          if (!(le = r[h])) return "break";
                          (b =
                            re.isLayoutRTL === le.isLayoutRTL
                              ? 0
                              : le.widths.length),
                            (L = (re = le).isLayoutRTL
                              ? 0 == b
                                ? re.x + re.widthSum
                                : re.x
                              : 0 == b
                              ? re.x
                              : re.x + re.widthSum),
                            (C = h);
                        } else if (de) {
                          var p = t.doc.contentControls
                              .collect(o - 1, 1)
                              .sort(function (e, t) {
                                return e.len - t.len;
                              }),
                            u = l()(p, 1)[0];
                          if (u && u.isDate) return "break";
                          var g = re.isLayoutRTL ? C + 1 : C - 1;
                          if (!(le = r[g])) return "break";
                          (b = re.isLayoutRTL
                            ? re.isLayoutRTL === le.isLayoutRTL
                              ? le.widths.length
                              : 0
                            : le.widths.length - 1),
                            (L = re.isLayoutRTL ? re.x : le.x + le.widthSum),
                            (re = le),
                            (C = g);
                        }
                      };
                    do {
                      if ("break" === he()) break;
                    } while (ce || de);
                    (a.isLineLastChar = !1),
                      (a.glyphGroupInfo = re),
                      (a.position = re.beginOffset + n.range.pos + b),
                      re.isCombine &&
                        a.glyphTail &&
                        (a.position += re.endOffset - re.beginOffset - 1),
                      (a.charWidth = re.widths[b]),
                      (a.height = n.rect.bottom - n.rect.top),
                      (a.drawHeight =
                        re.zone.getLineDrawHeight &&
                        re.zone.getLineDrawHeight(re)),
                      (ee = L),
                      (te = re.y);
                    var pe =
                        (re.zone.getDrawBaseline &&
                          re.zone.getDrawBaseline(n.baseline, re)) ||
                        n.baseline,
                      ue = re.metrics,
                      fe = re.y + pe - ue.ascent;
                    for (
                      ie = Math.max(te, fe),
                        a.charHeight = Math.max(
                          0,
                          Math.min(fe + ue.height - ie, te + a.height - ie)
                        ),
                        a.line = n,
                        0 === b &&
                          f.default.isLineBreak(m.getCharCode(a.position)) &&
                          (a.lineBreakHit = !0);
                      m.getCharCode(a.position) === y.FieldEnd;

                    )
                      ++a.position;
                    var ge = a.lineBreakHit ? 8 : 0;
                    if (
                      (i.x < re.x - ge
                        ? 0 == C && 0 == b && (a.isFuzzyHit = !0)
                        : i.x > re.x + re.widthSum + ge && (a.isFuzzyHit = !0),
                      a.isFuzzyHit ||
                        a.isFuzzyHitOnLine ||
                        !re.isField() ||
                        t.doc.fields.rangeClass.forEachHintInRange(
                          re.beginOffset + n.range.pos,
                          re.beginOffset + n.range.pos,
                          function (e) {
                            if ("HYPERLINK" === e._node.type) {
                              a.type = g.HIT_RESULT_TYPES.HYPERLINK;
                              var i = new v.a(t, e._node);
                              return (
                                (a.hyperLink = i),
                                (a.isATField =
                                  i.isMentionAddress() ||
                                  i.isFileLinkAddress()),
                                !0
                              );
                            }
                          },
                          c.IT.strictIntersectTest
                        ),
                      re.oMath)
                    ) {
                      var ve = re.oMath.locate(b);
                      (ee = re.x + ve.x),
                        (te =
                          re.y +
                          n.baseline -
                          re.oMath.baseline +
                          ve.y -
                          (ve.charHeight - ve.height) / 2),
                        ve.data &&
                          ve.data.shape &&
                          ((a.shapeForMath = ve.data.shape),
                          (a.offsetOfGlyphGroupInfo = b)),
                        (a.charHeight = ve.charHeight),
                        (a.drawHeight = a.charHeight),
                        (ie = te);
                    }
                  }
                  if (
                    (a.shapeForMath ||
                      (a.glyphGroupInfo && a.glyphGroupInfo.shape)) &&
                    s.hitEmbed(a, s)
                  )
                    return !0;
                  a.line = n;
                  var ye = s.getCurrentCoor().node,
                    _e = ye.textflow;
                  if ("T2B" === _e.corX) {
                    if (_e.isReverseLine) {
                      var Pe = ye.rect.width - n.rect.top - n.rect.height;
                      (te = te - n.rect.top + Pe), (ie = ie - n.rect.top + Pe);
                    }
                    (a.posX = S.x + ye.rect.width - te),
                      (a.posY = S.y + ee),
                      (a.charPosY = a.posY),
                      (a.charPosX = S.x + ye.rect.width - ie - a.charHeight),
                      (a.isTranspose = !0);
                  } else
                    "B2T" === _e.corX
                      ? ((a.posX = S.x + te),
                        (a.posY = S.y + ye.rect.height - ee),
                        (a.charPosY = a.posY),
                        (a.charPosX = S.x + ie),
                        (a.isTranspose = !0))
                      : ((a.posX = S.x + ee),
                        (a.posY = S.y + te),
                        (a.charPosY = S.y + ie),
                        (a.charPosX = a.posX));
                  if (ye.parent.layoutType === P.DOCLayoutType.ShapeScene) {
                    var Te = ye.parent.getTextBoxRect(),
                      Ee = S.x - ye.rect.left + Te.left,
                      Se = S.y - ye.rect.top + Te.top;
                    a.clipRect = {
                      left: Ee,
                      top: Se,
                      width: Te.width,
                      height: Te.height,
                    };
                  } else if (
                    ye.layoutType === P.DOCLayoutType.CellPage &&
                    ye.parent.diagCell
                  ) {
                    var xe = S.x - ye.rect.left,
                      be = S.y - ye.rect.top,
                      Ce = ye.parent.rect,
                      Le = Ce.width,
                      me = Ce.height;
                    a.clipRect = { left: xe, top: be, width: Le, height: me };
                  } else
                    ye.layoutType == P.DOCLayoutType.MainPage &&
                      (a.clipRect = ye.viewPage.outer_rect);
                  return (
                    (a.posX = Math.round(a.posX)),
                    (a.posY = Math.round(a.posY)),
                    (a.charPosY = Math.round(a.charPosY)),
                    (a.charPosX = Math.round(a.charPosX)),
                    !0
                  );
                },
              },
              {
                key: "sublinesHit",
                value: function (t, i, n, o, a, s) {
                  for (
                    var r = Number.MAX_SAFE_INTEGER, l = -1, c = 0;
                    c < n.length;
                    ++c
                  ) {
                    var h = n[c].rect,
                      p = d.default.distanceFromPointToRect(i, h);
                    if (p < r && ((r = p), (l = c), 0 === p)) break;
                  }
                  if (-1 == l) return !1;
                  var u = n[l];
                  return !!e.hitLine(t, i, u, o, a, s);
                },
              },
              {
                key: "tablecellsHit",
                value: function (e, t, i, n, o) {
                  for (
                    var a = Number.MAX_SAFE_INTEGER, s = -1, r = 0;
                    r < i.length;
                    ++r
                  ) {
                    var l = i[r],
                      c = l.rect,
                      p = d.default.distanceFromPointToRect(t, c);
                    if (
                      p < a &&
                      ((l.cell_page && l.cell_page.lines.length) ||
                        (l.is_diag_cell && l.diagCell.pages.length)) &&
                      ((a = p), (s = r), 0 === p)
                    )
                      break;
                  }
                  if (-1 == s) return !1;
                  var f = i[s],
                    g = h.default.initWithOrigin({
                      x: t.x - f.position2parent.x,
                      y: t.y - f.position2parent.y,
                    });
                  return !!u.hit(e, g, f, n, o) && ((n.tablecellIdx = s), !0);
                },
              },
              {
                key: "hitOnShape",
                value: function (e, t, i, n) {
                  if (((i.glyphGroupInfo = n), window.APP.isMobileMode())) {
                    var o = !!n.shape;
                    return o
                      ? {
                          isHitOnShape: o,
                          mobilePage: t.viewPage,
                          shape: n.shape,
                          line: t,
                        }
                      : { isHitOnShape: o };
                  }
                },
              },
            ]),
            e
          );
        })(),
        S = i(1413),
        x = i(586),
        b = i(1257),
        C = i(635),
        L = i(39),
        m = i.n(L),
        I = i(40),
        R = i.n(I),
        w = i(1281),
        A = i(1966),
        H = 0,
        k = 1,
        O = (function (e) {
          function t(e, i, n) {
            o()(this, t);
            var a = m()(
                this,
                (t.__proto__ || Object.getPrototypeOf(t)).call(this, {
                  parent: e,
                  viewPage: e.viewPage,
                  coorSystem: null,
                })
              ),
              s = e.heightAt(i);
            return (
              (a.range = new A.default(n.pos, n.pos + n.len, a)),
              (a.pendingNode = new w.e()),
              (a.pendingNode.line = a),
              (a.rect = d.default.initByRawRect({
                top: s,
                left: 0,
                right: e.rect.width,
                bottom: s + 1,
              })),
              a
            );
          }
          return (
            R()(t, e),
            s()(t, [
              {
                key: "moveTo",
                value: function (e) {
                  var t = e - this.rect.top,
                    i = this.rect.height;
                  (this.rect.top += t), (this.rect.bottom = this.rect.top + i);
                },
              },
              {
                key: "toString",
                value: function () {
                  return "" + this.range;
                },
              },
              {
                key: "layoutType",
                get: function () {
                  return p.DOCLayoutType.Pending;
                },
              },
              {
                key: "yForView",
                get: function () {
                  return this.viewOffset.y;
                },
              },
              {
                key: "pendingType",
                get: function () {
                  return H;
                },
              },
            ]),
            t
          );
        })(p.DOCLayout),
        F =
          ((function (e) {
            function t(e, i) {
              o()(this, t);
              var n = m()(
                this,
                (t.__proto__ || Object.getPrototypeOf(t)).call(this, {
                  parent: e.page,
                  viewPage: e,
                  coorSystem: null,
                })
              );
              return (
                (n.detail = i),
                (n.pendingNode = new w.e()),
                (n.pendingNode.line = n),
                n
              );
            }
            R()(t, e),
              s()(t, [
                {
                  key: "mobilePage",
                  get: function () {
                    return this.viewPage;
                  },
                },
                {
                  key: "layoutType",
                  get: function () {
                    return p.DOCLayoutType.Pending;
                  },
                },
                {
                  key: "yForView",
                  get: function () {
                    return this.viewPage.offsetTopOfComments;
                  },
                },
                {
                  key: "pendingType",
                  get: function () {
                    return k;
                  },
                },
              ]);
          })(p.DOCLayout),
          i(4141)),
        D = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hit",
                value: function (t, i, n, o, a) {
                  a.enter(n);
                  var s = e.hitPage(t, i, n, o, a);
                  return a.exit(), s;
                },
              },
              {
                key: "hitPage",
                value: function (e, t, i, n, o) {
                  var a = {
                      x: t.x - i.position2parent.x,
                      y: t.y - i.position2parent.y,
                    },
                    s = i.textflow;
                  if ("T2B" === s.corX) {
                    var r = a.y,
                      l = i.rect.width - a.x;
                    (a.x = r),
                      (a.y = l),
                      s.isReverseLine && (a.y = i.rect.width - a.y);
                  } else if ("B2T" === s.corX) {
                    var c = i.rect.height - a.y,
                      h = a.x;
                    (a.x = c), (a.y = h);
                  }
                  for (
                    var p = i.lines,
                      u = Number.MAX_SAFE_INTEGER,
                      f = -1,
                      g = void 0,
                      v = 0;
                    v < p.length;
                    ++v
                  ) {
                    var y = p[v];
                    if (
                      !(y instanceof O || y.isSnippetLine) &&
                      !(
                        (0 === y.rect.height && p.length > 1) ||
                        (i instanceof x.a && Object(F.h)(v, i, e.glyphpool, !0))
                      )
                    ) {
                      var _ = y.renderRect || y.rect,
                        P = d.default.verticalDistanceFromPointToRect(a, _);
                      if (y.isRepeatHeaderRow) {
                        g = P;
                        continue;
                      }
                      P < u && ((u = P), (f = v));
                    }
                  }
                  if (-1 === f) return !1;
                  (n.isFuzzyHitOnLine = 0 !== u),
                    void 0 !== g && g < u && (n.isInRepeatHeaderRow = !0);
                  var T = p[f];
                  if (T instanceof b.default && T.hasMergedCell) {
                    for (
                      var L = Number.MAX_SAFE_INTEGER,
                        m = -1,
                        I = {
                          x: a.x - T.position2parent.x,
                          y: a.y - T.position2parent.y,
                        },
                        R = 0;
                      R < T.tablecells.length;
                      ++R
                    ) {
                      var w = T.tablecells[R].rect,
                        A = d.default.distanceFromPointToRect(I, w);
                      if (A < L && ((L = A), (m = R), 0 === A)) break;
                    }
                    var H = T.tablecells[m];
                    if (
                      -1 !== m &&
                      (H.merge_type === C.MERGE_TYPE.MIDDLE ||
                        H.merge_type === C.MERGE_TYPE.LAST)
                    ) {
                      var k = Object(S.findFirstMergeLine)(H.rect.left, f, p);
                      null !== k && (T = k);
                    }
                  }
                  var D = E.hit(e, a, T, {}, n, o);
                  return (
                    (n.layoutPos = t),
                    !!D && ((n.isFuzzyHit = 0 != u || n.isFuzzyHit), !0)
                  );
                },
              },
            ]),
            e
          );
        })(),
        B = (t.a = D);
    },
    3770: function (e, t, i) {
      "use strict";
      var n = i(1),
        o = i.n(n),
        a = i(2),
        s = i.n(a),
        r = i(3495),
        l = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hit",
                value: function (t, i, n, o, a) {
                  a.enter(n);
                  var s = e.hitMobilePage(t, i, n, o, a);
                  return a.exit(), s;
                },
              },
              {
                key: "hitMobilePage",
                value: function (e, t, i, n, o) {
                  return !!r.a.hit(e, t, i.page, n, o) && ((n.pageIdx = 0), !0);
                },
              },
            ]),
            e
          );
        })(),
        c = i(298),
        d = i(6800),
        h = i.n(d),
        p = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hit",
                value: function (t, i, n, o) {
                  (o.hitEmbed = function (e, i) {
                    return h.a.hitEmbed(t, e, i);
                  }),
                    o.enter(n);
                  var a = e.hitView(t, i, n, o);
                  return o.exit(), a;
                },
              },
              {
                key: "hitView",
                value: function (e, t, i, n) {
                  var o = {},
                    a = !1;
                  (t.y -= i.viewOffset.y),
                    t.y < i.verticalPadding &&
                      (window.APP.isWebMode() && t.y > 0 && (a = !0),
                      (t.y = i.verticalPadding));
                  var s = i.hitViewPage(t.y);
                  if (s) {
                    t.x -= i.viewOffset.x;
                    var r = s.page;
                    return (
                      (t.x -= r.rect.left - r._drawingOffset.x),
                      (t.y -= r.rect.top),
                      !!l.hit(e, t, r, o, n) &&
                        ((o.layoutIndex = r.layout_index),
                        (o.subDocType = c.MainText),
                        (o.pos = t),
                        a && (o.hitFileName = !0),
                        (o.isFuzzyHitOnLine || o.isFuzzyHit) &&
                          h.a.hitDrawing(e, t, r, o),
                        o)
                    );
                  }
                },
              },
            ]),
            e
          );
        })(),
        u = i(5793),
        f = i(345),
        g = i(5095),
        v = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hit",
                value: function (e, t, i, n, o) {
                  for (
                    var a = Number.MAX_SAFE_INTEGER, s = -1, r = 0, l = 0;
                    l < e.typoinfo.pageCount;
                    ++l
                  ) {
                    var c = e.typoinfo.getLayoutPageCache(l);
                    if (!c) return !1;
                    var d = c.outer_rect,
                      h = f.default.distanceFromPointToRect(t, d);
                    if ((h < a ? ((a = h), (s = l), (r = 0)) : ++r, 3 == r))
                      break;
                  }
                  if (-1 == s) return !1;
                  var p = i[s],
                    v = p;
                  if (e.selection.selContext.isInHeaderFooter) {
                    if (!p.decorativePage) return !1;
                    v = p.decorativePage;
                  }
                  if (p instanceof g.a)
                    return (
                      e.typoinfo.queryRangeForPage(
                        p.layout_index,
                        p.layout_index
                      ),
                      !1
                    );
                  var y = u.a.hit(e, t, v, n, o);
                  return (
                    y &&
                      ((n.layoutIndex = s),
                      (n.isFuzzyHit = 0 != a || n.isFuzzyHit)),
                    y
                  );
                },
              },
            ]),
            e
          );
        })(),
        y = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hit",
                value: function (e, t, i, n, o) {
                  o.enter(i);
                  var a = r.a.hit(e, t, i.page, n, o);
                  return o.exit(), a;
                },
              },
            ]),
            e
          );
        })(),
        _ = i(2004),
        P = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hitView",
                value: function (e, t, i, n) {
                  var o = {},
                    a = i.getCommentPage(n.commentId),
                    s = {
                      x: t.x - i.horizontalPadding,
                      y: t.y - i.verticalPadding,
                    };
                  return (
                    !(Object(_.isInTempComment)() || !a) &&
                    !!y.hit(e, s, a, o, n) &&
                    ((o.pos = t),
                    (o.isInComment = !0),
                    (o.subDocType = c.Comment),
                    o)
                  );
                },
              },
              {
                key: "hit",
                value: function (t, i, n, o) {
                  var a = n.getCommentView(o.commentId);
                  o.enter(a);
                  var s = e.hitView(t, i, a, o);
                  return o.exit(), s;
                },
              },
            ]),
            e
          );
        })(),
        T = i(1238),
        E = i(1450),
        S = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hit",
                value: function (e, t, i, n) {
                  var o = new T.default({
                    mode: E.b,
                    logColor: { color1: "red", color2: "blue" },
                  });
                  if (
                    (n && Object.assign(o, n),
                    e.selection.selContext.isInComment())
                  )
                    return P.hit(e, t, i, o);
                  if (window.APP.isPCMode() || window.APP.isPaginationMode()) {
                    var a = {};
                    return v.hit(e, t, i.layout_pages, a, o) && a;
                  }
                  return p.hit(e, t, i, o);
                },
              },
            ]),
            e
          );
        })();
      t.a = S;
    },
    4141: function (e, t, i) {
      "use strict";
      i.d(t, "a", function () {
        return p;
      }),
        i.d(t, "b", function () {
          return u;
        }),
        i.d(t, "g", function () {
          return f;
        }),
        i.d(t, "f", function () {
          return v;
        }),
        i.d(t, "d", function () {
          return y;
        }),
        i.d(t, "e", function () {
          return _;
        }),
        i.d(t, "c", function () {
          return P;
        }),
        i.d(t, "h", function () {
          return T;
        });
      var n = i(1),
        o = i.n(n),
        a = i(2),
        s = i.n(a),
        r = i(635),
        l = i(315),
        c = i(290),
        d = i(1372);
      function h(e, t) {
        return !!(Math.abs(t - e) <= 1 && t && e);
      }
      var p = (function () {
          function e(t) {
            o()(this, e), (this.tableLine = t);
          }
          return (
            s()(e, [
              {
                key: "calcOffset",
                value: function (e, t) {
                  var i = t.cell_page;
                  if (i && i.lines.length) {
                    var n = t.layers,
                      o = 0;
                    n &&
                      ((o += (n.bottomCards && n.bottomCards.length) || 0),
                      (o += (n.topCards && n.topCards.length) || 0),
                      (o += (n.textframes && n.textframes.length) || 0));
                    var a = t.cell2page_offset.x,
                      s = t.cell2page_offset.y;
                    if (t.align_type === r.ALIGN_TYPE.TOP || o > 0)
                      return (
                        (t.cell2page_offset.x = 0),
                        (t.cell2page_offset.y = 0),
                        void (
                          (t.cell2page_offset.x === a &&
                            t.cell2page_offset.y === s) ||
                          !i.renderInfo ||
                          ((i.renderInfo.moved = !0),
                          (t.parent.renderInfo.expired = !0))
                        )
                      );
                    var l = 0;
                    if (i.lines.length > 0) {
                      var c = i.lines[i.lines.length - 1];
                      l = c.rect.bottom + c.after_space;
                    }
                    var d = t.cell_page.textflow,
                      p = d.corX,
                      u = d.isReverseLine,
                      f = t.cell_page.rect.width;
                    switch (p) {
                      case "T2B":
                        u
                          ? t.align_type === r.ALIGN_TYPE.Center
                            ? (t.cell2page_offset.x = (f - l) / 2)
                            : (t.cell2page_offset.x = f - l)
                          : t.align_type === r.ALIGN_TYPE.Center
                          ? (t.cell2page_offset.x = -(f - l) / 2)
                          : (t.cell2page_offset.x = -(f - l));
                        break;
                      case "B2T":
                        t.align_type === r.ALIGN_TYPE.Center
                          ? (t.cell2page_offset.x = (f - l) / 2)
                          : (t.cell2page_offset.x = f - l);
                        break;
                      default:
                        var g = 0;
                        0 != e &&
                          (g =
                            e -
                            this.btmSpacingExtend -
                            this.maxBottomMargin -
                            i.rect.top),
                          l <= g
                            ? t.align_type === r.ALIGN_TYPE.Center
                              ? h((g - l) / 2, t.cell2page_offset.y) ||
                                (t.cell2page_offset.y = (g - l) / 2)
                              : h(g - l, t.cell2page_offset.y) ||
                                (t.cell2page_offset.y = g - l)
                            : (t.cell2page_offset.y = 0);
                    }
                    (t.cell2page_offset.x === a &&
                      t.cell2page_offset.y === s) ||
                      !i.renderInfo ||
                      ((i.renderInfo.moved = !0),
                      (t.parent.renderInfo.expired = !0));
                  }
                },
              },
              {
                key: "maxBottomMargin",
                get: function () {
                  return this.tableLine.maxBottomMargin;
                },
              },
              {
                key: "btmSpacingExtend",
                get: function () {
                  return g(this.tableLine);
                },
              },
            ]),
            e
          );
        })(),
        u = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "getTableTopGap",
                value: function (e) {
                  return Math.max(e.maxTopMargin, e.maxTopBorder);
                },
              },
              {
                key: "getTableTopSpacing",
                value: function (t) {
                  var i = t.spacing;
                  return e.isFirstTableLine(t) && (i += t.spacing), i;
                },
              },
              {
                key: "isFirstTableLine",
                value: function (e) {
                  var t = e.parent;
                  if (0 === t.lines.length) return !0;
                  var i = t.lines[t.lines.length - 1];
                  if (i === e) {
                    if (1 === t.lines.length) return !0;
                    i = t.lines[t.lines.length - 2];
                  }
                  return i.layoutType !== l.DOCLayoutType.TableLine;
                },
              },
              {
                key: "findBreakLine",
                value: function (e, t, i) {
                  if (!e || !i || 0 === i.lines.length) return null;
                  if (e.parent !== t) {
                    if (!e.isBrokenAfter) return null;
                  } else if (!e.isBrokenBefore) return null;
                  var n = null,
                    o = i.lines.length - 1;
                  do {
                    var a = i.lines[o];
                    if (a.layoutType !== l.DOCLayoutType.TableLine) break;
                    if (!a.isBrokenAfter) break;
                    if (e.parent === t && a.range.end === e.range.end) break;
                    (n = a), --o;
                  } while (o >= 0);
                  return n;
                },
              },
            ]),
            e
          );
        })();
      function f(e, t) {
        var i = t.parent;
        if (0 === i.lines.length) return null;
        var n = i.lines.findIndex(function (e) {
          return e === t;
        });
        -1 === n && (n = i.lines.length - 1);
        for (var o = n; o >= 0; --o) {
          var a = i.lines[o];
          if (a.layoutType !== l.DOCLayoutType.TableLine) break;
          for (var s = !1, c = 0; c < a.tablecells.length; ++c) {
            var d = a.tablecells[c];
            if (e >= d.rect.left && e < d.rect.right) {
              if (((s = !0), d.merge_type === r.MERGE_TYPE.FIRST)) return d;
              d.merge_type === r.MERGE_TYPE.NONE && (s = !1);
              break;
            }
            if (e < d.rect.left) break;
          }
          if (!1 === s) break;
        }
        return null;
      }
      function g(e) {
        return e.isTableLast ? 2 * e.spacing : e.spacing;
      }
      function v(e) {
        return e.hasSpacing ? e.maxBottomBorder + g(e) : 0;
      }
      function y(e, t) {
        if (0 === e.parent.lines.length) return !1;
        var i = !0;
        return (
          t.tablecells.forEach(function (t) {
            if (t.isBrokenAfter) i = !1;
            else if (t.merge_type === r.MERGE_TYPE.LAST) {
              var n;
              if ((n = f(t.rect.left, e)) && n.isBrokenBefore)
                return void (i = !1);
            }
          }),
          i
        );
      }
      function _(e) {
        return Object(d.b)(
          window.APP.data.doc.getDataLogic("final").getChpx(e.range.end - 1)
            .prop
        ) || e.hasSpacing
          ? 0
          : e.maxBottomBorder;
      }
      function P(e, t) {
        for (
          var i = e.tablecells,
            n = e.renderInfo && e.renderInfo.height !== e.rect.height,
            o = 0;
          o < i.length;
          ++o
        ) {
          var a = i[o];
          if (
            ((e.isTableLast || t) && a.merge_type !== r.MERGE_TYPE.NONE) ||
            a.merge_type === r.MERGE_TYPE.LAST ||
            (a.merge_type === r.MERGE_TYPE.MIDDLE && e.isPackLast)
          ) {
            var s;
            if (
              !(s = f(a.rect.left, e)) ||
              (!s.cell_page && !s.diagCell) ||
              (s.cell_page && s.cell_page.prev)
            )
              continue;
            var l = s.parent;
            if (
              (!l.renderInfo ||
                (e.renderInfo && !n) ||
                (l.renderInfo.moved = !0),
              s.align_type === r.ALIGN_TYPE.TOP)
            )
              continue;
            var c = e.rect.bottom - l.rect.top;
            new p(e).calcOffset(c, s);
          }
        }
      }
      function T(e, t, i, n) {
        if (e > 0 && e === t.lines.length - 1) {
          var o = t.lines[e - 1];
          if (
            o.layoutType === l.DOCLayoutType.TableLine ||
            (o.layoutType === l.DOCLayoutType.SnippetLine && !n)
          ) {
            var a = t.lines[e];
            if (1 === a.range.len)
              if (i.glyphBuff.getCharCode(a.range.pos) === c.EndPara) return !0;
          }
        }
        return !1;
      }
    },
    4968: function (e, t, i) {
      "use strict";
      function n(e) {
        var t = void 0,
          i = void 0,
          n = void 0;
        if (e.oMath) {
          var o = e.orgGlyphGroups && e.orgGlyphGroups[0];
          (t = o.isFootnote()),
            (i = o.isEndnote()),
            (n = !t && !i && o.isFootEndNotePlaceholder());
        } else
          (t = e.isFootnote()),
            (i = e.isEndnote()),
            (n = e.isNotePlaceholder());
        return t || i || n ? { isFootnote: t, isPlaceHolder: n } : null;
      }
      i.d(t, "a", function () {
        return n;
      });
    },
    4969: function (e, t, i) {
      "use strict";
      Object.defineProperty(t, "__esModule", { value: !0 });
      var n = i(21),
        o = n.__importDefault(i(345)),
        a = i(1194),
        s = i(2074),
        r = i(770);
      var l = (function () {
        function e() {}
        return (
          (e.initHitPageFunc = function (t) {
            e.g_funHitPage = t;
          }),
          (e.hitShapes = function (t, i, r, l, c, d, h) {
            var p,
              u = r.outer_rect,
              f = { x: i.x - u.left, y: i.y - u.top },
              g = r.layers;
            h
              ? (p = g.getBottomShapeCards())
              : ((p = g.getTopShapeCards()),
                g &&
                  g.childLayers &&
                  g.childLayers.forEach(function (e) {
                    var t = e.getTopShapeCards();
                    t.length &&
                      (p = n.__spreadArray(n.__spreadArray([], t, !0), p, !0));
                  }));
            for (
              var v = window.APP.drawingTools, y = c.justText, _ = p.length - 1;
              _ >= 0;
              --_
            ) {
              var P = p[_],
                T = P.id,
                E = P.coor_pos2view,
                S = P.innerBoundary,
                x = P.layoutRect,
                b = P.rect,
                C = S
                  ? o.default.initByOriginAndSize(
                      { x: P.rect.left + S.left, y: P.rect.top + S.top },
                      { width: S.width, height: S.height }
                    )
                  : o.default.initByRawRect(b);
              if (
                (E &&
                  ((b = o.default.getRectByRectAndOffset(b, E)),
                  (C = o.default.getRectByRectAndOffset(C, E)),
                  (x = o.default.getRectByRectAndOffset(x, E))),
                P.isRotateText &&
                  P.hasEnterTextbox() &&
                  0 !== P.rotation &&
                  (0, s.rotateRect)(-P.rotation, C),
                f.x >= C.left - 5 &&
                  f.x <= C.right + 5 &&
                  f.y >= C.top - 5 &&
                  f.y <= C.bottom + 5)
              ) {
                var L = f.x - b.left,
                  m = f.y - b.top;
                if (!P.isGroup) {
                  if (e.hitTextbox(t, P, L, m, l, c)) return !0;
                  if (y) continue;
                  var I =
                    P.isRotateText && P.hasEnterTextbox() ? 0 : P.rotation;
                  if (P.isPresetDrawing) {
                    if (0 !== I || P.horizontalFlipped || P.verticalFlipped) {
                      var R = v.createQMatrix();
                      R.translate(b.width / 2, b.height / 2),
                        (P.horizontalFlipped || P.verticalFlipped) &&
                          R.scale(
                            P.horizontalFlipped ? -1 : 1,
                            P.verticalFlipped ? -1 : 1
                          ),
                        R.rotate(-I),
                        R.translate(-b.width / 2, -b.height / 2);
                      var w = R.map_point(
                        new window.Point(f.x - b.left, f.y - b.top)
                      );
                      (L = w.x()), (m = w.y());
                    }
                    if (!v.hitTest(P.drawingLayout, new window.Point(L, m), 5))
                      continue;
                  } else if (
                    0 !== I &&
                    !(0, s.pointInRotateRect)(
                      f,
                      E ? o.default.getRectByRectAndOffset(P.rect, E) : P.rect,
                      I
                    )
                  )
                    continue;
                  var A = o.default.getRectByRectAndOffset(x, {
                      x: u.left,
                      y: u.top,
                    }),
                    H = P.begin;
                  return (
                    (l.shapeInfo = {
                      isHitOnShape: !0,
                      gcp: H,
                      id: T,
                      rect: A,
                      shape: P,
                      isEmbedding: !1,
                      isInk: P.isInk,
                    }),
                    (l.isWebshape = P && P.isWebshape),
                    (l.webExtension = P && P.webExtension),
                    (l.type = a.HIT_RESULT_TYPES.SHAPE),
                    !0
                  );
                }
                if (e.hitGroupShape(t, P, L, m, u, l, c)) return !0;
              }
            }
            return !1;
          }),
          (e.hitGroupShape = function (t, i, n, r, l, c, d) {
            for (
              var h,
                p = (function e(t, i) {
                  return (
                    void 0 === i && (i = []),
                    t.isCanvasShape && i.push(t),
                    t.childShapes &&
                      t.childShapes.forEach(function (t) {
                        t.isGroup ? e(t, i) : i.push(t);
                      }),
                    i
                  );
                })(i),
                u = window.APP.drawingTools,
                f = d.justText,
                g = p.length - 1;
              g >= 0;
              --g
            ) {
              var v = p[g],
                y = v.innerBoundary,
                _ = v.visualTransform2D,
                P =
                  void 0 === _
                    ? {
                        rotation: 0,
                        horizontalFlipped: !1,
                        verticalFlipped: !1,
                      }
                    : _,
                T = v.drawingLayout.layoutRect,
                E = v.rect2TopShape;
              if (!E && v.isTopShape) {
                var S = v.rect;
                E = { top: 0, left: 0, width: S.width, height: S.height };
              }
              if (e.hitTextbox(t, v, n - E.left, r - E.top, c, d)) return !0;
              if (!f) {
                var x = y
                    ? {
                        x: E.left + y.left,
                        y: E.top + y.top,
                        width: y.width,
                        height: y.height,
                      }
                    : T,
                  b = v.isRotateText && v.hasEnterTextbox() ? 0 : P.rotation;
                if (v.isPresetDrawing && !v.isCanvasShape) {
                  if (
                    n >= x.x &&
                    n < x.x + x.width &&
                    r >= x.y &&
                    r <= x.y + x.height
                  )
                    if (b || P.horizontalFlipped || P.verticalFlipped) {
                      var C = u.createQMatrix();
                      C.translate(E.width / 2, E.height / 2),
                        (P.horizontalFlipped || P.verticalFlipped) &&
                          C.scale(
                            P.horizontalFlipped ? -1 : 1,
                            P.verticalFlipped ? -1 : 1
                          ),
                        C.rotate(-b),
                        C.translate(-E.width / 2, -E.height / 2);
                      var L = C.map_point(
                        new window.Point(n - E.left, r - E.top)
                      );
                      if (
                        u.hitTest(
                          v.drawingLayout,
                          new window.Point(L.x(), L.y()),
                          5
                        )
                      ) {
                        h = v;
                        break;
                      }
                    } else if (
                      u.hitTest(
                        v.drawingLayout,
                        new window.Point(n - E.left, r - E.top),
                        5
                      )
                    ) {
                      h = v;
                      break;
                    }
                } else if (
                  (0, s.pointInRotateRect)(
                    { x: n, y: r },
                    {
                      left: E.left,
                      top: E.top,
                      width: E.width,
                      height: E.height,
                    },
                    b
                  )
                ) {
                  h = v;
                  break;
                }
              }
            }
            if (!h) return !1;
            var m = window.APP.data.selection.selShapes || [],
              I = [];
            m.forEach(function (e) {
              e.isChildShape && I.push(e.topShape);
            });
            var R = i.layoutRect;
            if (m.includes(i) || I.includes(i)) {
              var w = o.default.getRectByRectAndOffset(R, {
                x: l.left,
                y: l.top,
              });
              T = h.drawingLayout.layoutRect;
              w.offset(T.x, T.y), w.updateBySize(T.width, T.height);
              var A = h.shapeIdxPath,
                H = h.shape_tree_type;
              return (
                (c.shapeInfo = {
                  id: h.id,
                  isHitOnShape: !0,
                  gcp: i.begin,
                  shapeIdxPath: A,
                  shapeTreeType: H,
                  rect: w,
                  shape: h,
                  isEmbedding: !1,
                  isInk: h.isInk,
                }),
                (c.isWebshape = h && h.isWebshape),
                (c.webExtension = h && h.webExtension),
                (c.type = a.HIT_RESULT_TYPES.SHAPE),
                !0
              );
            }
            var k = o.default.getRectByRectAndOffset(R, {
                x: l.left,
                y: l.top,
              }),
              O = i.begin;
            return (
              (c.shapeInfo = {
                isHitOnShape: !0,
                gcp: O,
                id: i.id,
                rect: k,
                shape: i,
                isEmbedding: !1,
                isInk: i.isInk,
              }),
              (c.isWebshape = i && i.isWebshape),
              (c.webExtension = i && i.webExtension),
              (c.type = a.HIT_RESULT_TYPES.SHAPE),
              !0
            );
          }),
          (e.hitTextbox = function (t, i, n, o, r, l) {
            var c = i.textbox_page;
            if (!c || !c.lines.length) return !1;
            var d = i.visualRotation,
              h = i.isRotateText && !i.hasEnterTextbox() ? d : 0;
            if (
              (0, s.pointInRotateRect)({ x: n, y: o }, i.getTextBoxRect(), h)
            ) {
              var p = e.enterTextboxContext(i, l);
              return (
                e.g_funHitPage(t, { x: n, y: o }, c, r, l),
                e.exitTextboxContext(p, l),
                r.shapeInfo && r.shapeInfo.isHitOnShape
                  ? !0
                  : ((r.type = a.HIT_RESULT_TYPES.TEXTBOX_PAGE),
                    (r.zorder = i.topShape.anchor.zorder),
                    (r.isInTextbox = !0),
                    (r.shapeIdxPathOfTextbox = i.shapeIdxPath),
                    (r.shapeTreeTypeOfTextbox = i.shape_tree_type),
                    (r.textbox = i),
                    !0)
              );
            }
            return !1;
          }),
          (e.enterTextboxContext = function (t, i) {
            for (var n = e.getParentNodePath(t), o = 0; o < n.length; ++o)
              i.enter(n[o]);
            return i.enter(t), n;
          }),
          (e.exitTextboxContext = function (e, t) {
            for (var i = 0; i < e.length; ++i) t.exit();
            t.exit();
          }),
          (e.getParentNodePath = function (e) {
            for (
              var t = e.outer, i = e, n = [];
              i.layoutType !== r.DOCLayoutType.LayoutPage &&
              (i = i.upper ? i.upper : i.isEmbedShape ? t.parent : i.parent)
                .layoutType !== r.DOCLayoutType.LayoutPage;

            )
              n.push(i);
            return n.reverse();
          }),
          (e.hitEmbed = function (t, i, n) {
            var r = i.glyphGroupInfo,
              l = i.shapeForMath,
              c = i.offsetOfGlyphGroupInfo,
              d = i.line,
              h = r.shape || l,
              p = h.id,
              u = h.viewRect,
              f = h.anchor,
              g = h.innerBoundary,
              v = h.isSeparatorLine,
              y = n.hitPos2View,
              _ = n.justText,
              P = h.viewPage.outer_rect,
              T = { x: y.x - P.left, y: y.y - P.top },
              E = d.parent.textflow || d.parent.parent.textflow,
              S = E && E.isTransposeCoor ? 5 : 0,
              x = E && E.isTransposeCoor ? 0 : 5,
              b = g
                ? o.default.initByOriginAndSize(
                    { x: u.left + g.left, y: u.top + g.top },
                    { width: g.width, height: g.height }
                  )
                : o.default.initByRawRect(u);
            if (
              (v && (b.offset(-8, -10), b.addSize({ width: 16, height: 20 })),
              T.x >= b.left - S &&
                T.x <= b.right + S &&
                T.y >= b.top - x &&
                T.y <= b.bottom + x)
            ) {
              var C = T.x - u.left,
                L = T.y - u.top;
              if (e.hitGroupShape(t, h, C, L, P, i, n)) return !0;
              if (e.hitTextbox(t, h, C, L, i, n)) return !0;
              if (_) return !1;
              var m = h.isRotateText && h.hasEnterTextbox() ? 0 : h.rotation,
                I = window.APP.drawingTools;
              if (!h.isPresetDrawing || v || h.isCanvasShape || h.isGroup) {
                if (0 !== m && !(0, s.pointInRotateRect)(T, u, m)) return !1;
              } else {
                if (0 !== m || h.horizontalFlipped || h.verticalFlipped) {
                  var R = I.createQMatrix();
                  R.translate(u.width / 2, u.height / 2),
                    (h.horizontalFlipped || h.verticalFlipped) &&
                      R.scale(
                        h.horizontalFlipped ? -1 : 1,
                        h.verticalFlipped ? -1 : 1
                      ),
                    R.rotate(-m),
                    R.translate(-u.width / 2, -u.height / 2);
                  var w = R.map_point(new window.Point(C, L));
                  (C = w.x()), (L = w.y());
                }
                if (!I.hitTest(h.drawingLayout, new window.Point(C, L), 5))
                  return !1;
              }
              var A = o.default.getRectByRectAndOffset(u, {
                  x: P.left,
                  y: P.top,
                }),
                H = r.beginOffset + i.line.range.pos + (c || 0),
                k = h.shapeIdxPath,
                O = h.shape_tree_type;
              return (
                (i.shapeInfo = {
                  isHitOnShape: !0,
                  gcp: H,
                  id: p,
                  rect: A,
                  shape: h,
                  shapeIdxPath: k,
                  shapeTreeType: O,
                  isEmbedding: !0,
                  shapeData: f.shapeData,
                }),
                (i.isWebshape = h && h.isWebshape),
                (i.webExtension = h && h.webExtension),
                (i.type = a.HIT_RESULT_TYPES.SHAPE),
                (i.posY = A.top),
                !0
              );
            }
            return !1;
          }),
          e
        );
      })();
      t.default = l;
    },
    5184: function (e, t, i) {
      "use strict";
      var n = i(1),
        o = i.n(n),
        a = i(2),
        s = i.n(a),
        r = i(5185),
        l = i(280),
        c = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "getLayoutCorner",
                value: function (e) {
                  var t = 1440,
                    i = 1440,
                    n = 1800,
                    o = 1800,
                    a = e.range;
                  if (a) {
                    var s = window.APP.data.doc.sections.getSection(a.pos);
                    if (s) {
                      var c = s.getPageMargin();
                      (t = c.top), (i = c.bottom), (n = c.left), (o = c.right);
                    }
                  }
                  var d = Object(l.Ti2Px)(t),
                    h = Object(l.Ti2Px)(i),
                    p = Object(l.Ti2Px)(n),
                    u = Object(l.Ti2Px)(o),
                    f = e.outer_rect,
                    g = r.b.T2B,
                    v = r.b.B2T,
                    y = r.a.L2R,
                    _ = r.a.R2L,
                    P = f.width - u,
                    T = f.height - h;
                  return {
                    header_footer_limit: { top: d, bottom: T },
                    left_top_corner: { x: p, y: d, ver: v, hor: _ },
                    right_top_corner: { x: P, y: d, ver: v, hor: y },
                    left_bottom_corner: { x: p, y: T, ver: g, hor: _ },
                    right_bottom_corner: { x: P, y: T, ver: g, hor: y },
                  };
                },
              },
            ]),
            e
          );
        })();
      t.a = c;
    },
    5185: function (e, t, i) {
      "use strict";
      i.d(t, "a", function () {
        return o;
      }),
        i.d(t, "b", function () {
          return n;
        });
      var n = { T2B: 0, B2T: 1 },
        o = { L2R: 0, R2L: 1 };
    },
    5793: function (e, t, i) {
      "use strict";
      var n = i(1),
        o = i.n(n),
        a = i(2),
        s = i.n(a),
        r = i(3495),
        l = i(345),
        c = i(298),
        d = i(6279),
        h = i(1194),
        p = i(315),
        u = i(1955),
        f = i(4969),
        g = i.n(f),
        v = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hit",
                value: function (t, i, n, o, a) {
                  (a.hitEmbed = function (e, i) {
                    return g.a.hitEmbed(t, e, i);
                  }),
                    (a.hitPos2View = i),
                    a.enter(n);
                  var s = !1;
                  if (t.selection.selContext.isInHeaderFooter)
                    s = d.a.hitEditModeHeaderFooter(t, i, n, o, a);
                  else {
                    var r =
                      void 0 === a.limitInSubdocType ||
                      a.limitInSubdocType === c.Textbox;
                    if (
                      (r && (s = g.a.hitShapes(t, i, n, o, a, !1, !1)),
                      !s &&
                        (window.APP.formatContentController
                          .isRestrictEditMode ||
                          window.APP.isPaginationMode() ||
                          d.a.hitReadModeHeaderFooter(t, i, n, o, a),
                        !(s = e.hitTextFrame(t, i, n, n.mainpages, o, a)) &&
                          (s = e.hitMainPage(t, i, n, n.mainpages, o, a)) &&
                          o.isFuzzyHit &&
                          r))
                    ) {
                      var l = {};
                      (s = g.a.hitShapes(t, i, n, l, a, !1, !0))
                        ? Object.assign(o, l)
                        : (s = !0);
                    }
                  }
                  return a.exit(), s;
                },
              },
              {
                key: "hasTextFrame",
                value: function (e) {
                  var t = e.getTextFrameInMainPage();
                  return t && t.length > 0;
                },
              },
              {
                key: "enterTextFrameContext",
                value: function (e, t) {
                  for (var i = e.length - 1; i >= 0; --i)
                    e[i].isCoorSystem && t.enter(e[i]);
                },
              },
              {
                key: "exitTextFrameContext",
                value: function (e, t) {
                  for (var i = e.length - 1; i >= 0; --i)
                    e[i].isCoorSystem && t.exit();
                },
              },
              {
                key: "hitTextFrame",
                value: function (t, i, n, o, a, s) {
                  for (
                    var d = n.outer_rect,
                      f = { x: i.x - d.left, y: i.y - d.top },
                      g = Number.MAX_SAFE_INTEGER,
                      v = -1,
                      y = 0;
                    y < o.length;
                    ++y
                  ) {
                    var _ = o[y],
                      P = l.default.distanceFromPointToRect(f, _.rect);
                    P < g && ((g = P), (v = y));
                  }
                  if (-1 == v) return !1;
                  for (
                    var T = n.getTextFrameInMainPage(), E = T.length - 1;
                    E >= 0;
                    --E
                  ) {
                    for (
                      var S = function (e) {
                          return e.parent
                            ? e.parent
                            : e.isScene()
                            ? e.upper
                            : null;
                        },
                        x = S(T[E]),
                        b = T[E].rect,
                        C = [],
                        L = { x: 0, y: 0 };
                      x.layoutType != p.DOCLayoutType.LayoutPage;

                    )
                      C.push(x),
                        (L.x += x.rect.left),
                        (L.y += x.rect.top),
                        (x = S(x));
                    if (
                      f.x >= b.left + L.x - u.TABLE_HOTSPOT_UNIT.MARGIN &&
                      f.x <= b.right + L.x &&
                      f.y >= b.top + L.y &&
                      f.y <= b.bottom + L.y
                    ) {
                      var m = { x: f.x - b.left - L.x, y: f.y - b.top - L.y },
                        I = T[E],
                        R = I.snippetPack,
                        w = void 0;
                      if (
                        R &&
                        (e.enterTextFrameContext(C, s),
                        s.enter(I),
                        (w = r.a.hit(t, m, R, a, s)),
                        s.exit(),
                        e.exitTextFrameContext(C, s),
                        a.type || (a.type = h.HIT_RESULT_TYPES.TEXTFRAME),
                        w)
                      )
                        return (
                          (a.pageIdx = v),
                          (a.subDocType = c.MainText),
                          (a.layoutPos.x += b.left + L.x),
                          (a.layoutPos.y += b.top + L.y),
                          w
                        );
                    }
                  }
                  return !1;
                },
              },
              {
                key: "hitMainPage",
                value: function (t, i, n, o, a, s) {
                  for (
                    var d = n.outer_rect,
                      h = { x: i.x - d.left, y: i.y - d.top },
                      p = Number.MAX_SAFE_INTEGER,
                      u = -1,
                      f = 0;
                    f < o.length;
                    ++f
                  ) {
                    var g = o[f],
                      v = l.default.distanceFromPointToRect(h, g.rect);
                    v < p && ((p = v), (u = f));
                  }
                  if (-1 == u) return !1;
                  var y = o[u],
                    _ = !1,
                    P = y.footnotes,
                    T = y.endnotes,
                    E = y.textflow,
                    S = y.rect,
                    x =
                      s.canHitNotes ||
                      void 0 === s.limitInSubdocType ||
                      s.limitInSubdocType === c.Footnote,
                    b =
                      s.canHitNotes ||
                      void 0 === s.limitInSubdocType ||
                      s.limitInSubdocType === c.Endnote,
                    C = void 0,
                    L = { x: h.x - S.left, y: h.y - S.top };
                  return (
                    "T2B" !== E.corX || E.isReverseLine
                      ? ("T2B" === E.corX && E.isReverseLine) ||
                        "B2T" === E.corX
                        ? P
                          ? T
                            ? (L.x >= P.rect.left || L.x >= T.rect.left) &&
                              (C =
                                l.default.distanceFromPointToRect(L, P.rect) <
                                l.default.distanceFromPointToRect(L, T.rect)
                                  ? x && P
                                  : b && T)
                            : L.x >= P.rect.left && (C = x && P)
                          : T && L.x >= T.rect.left && (C = b && T)
                        : P
                        ? T
                          ? (L.y >= P.rect.top || L.y >= T.rect.top) &&
                            (C =
                              l.default.distanceFromPointToRect(L, P.rect) <
                              l.default.distanceFromPointToRect(L, T.rect)
                                ? x && P
                                : b && T)
                          : L.y >= P.rect.top && (C = x && P)
                        : T && L.y >= T.rect.top && (C = b && T)
                      : P
                      ? T
                        ? (L.x <= P.rect.right || L.x <= T.rect.right) &&
                          (C =
                            l.default.distanceFromPointToRect(L, P.rect) <
                            l.default.distanceFromPointToRect(L, T.rect)
                              ? x && P
                              : b && T)
                        : L.x <= P.rect.right && (C = x && P)
                      : T && L.x <= T.rect.right && (C = b && T),
                    C &&
                    (s.enter(y),
                    (_ = e.hitFootEndNotes(C, L, a, s, t)),
                    s.exit(),
                    _)
                      ? ((a.pageIdx = u),
                        (a.subDocType = C === P ? c.Footnote : c.Endnote),
                        !0)
                      : !!(_ = r.a.hit(t, h, y, a, s)) &&
                        ((a.pageIdx = u), (a.subDocType = c.MainText), !0)
                  );
                },
              },
              {
                key: "hasTextbox",
                value: function (e) {
                  var t = e.getTextboxInMainPage();
                  return t && t.length > 0;
                },
              },
              {
                key: "hitFootEndNotes",
                value: function (e, t, i, n, o) {
                  for (
                    var a = e.rect,
                      s = { x: t.x - a.left, y: t.y - a.top },
                      c = Number.MAX_SAFE_INTEGER,
                      d = -1,
                      h = 0;
                    h < e.notes.length;
                    ++h
                  ) {
                    var p = e.notes[h].rect,
                      u = l.default.distanceFromPointToRect(s, p);
                    u < c && ((c = u), (d = h));
                  }
                  d < 0 && (d = 0), n.enter(e);
                  var f = e.notes[d],
                    g = f.rect;
                  return (
                    n.enter(f),
                    r.a.hit(
                      o,
                      { x: s.x - g.left, y: s.y - g.top },
                      f.note_page,
                      i,
                      n
                    ),
                    n.exit(),
                    n.exit(),
                    !0
                  );
                },
              },
            ]),
            e
          );
        })();
      (t.a = v),
        g.a.initHitPageFunc(function (e, t, i, n, o) {
          return r.a.hit(e, t, i, n, o);
        });
    },
    6198: function (e, t, i) {
      "use strict";
      i.d(t, "a", function () {
        return n;
      });
      var n = { None: 0, Hit_On_Header: 1, Hit_On_Footer: 2 };
    },
    6279: function (e, t, i) {
      "use strict";
      var n = i(1),
        o = i.n(n),
        a = i(2),
        s = i.n(a),
        r = i(345),
        l = i(260),
        c = i(3188),
        d = i(3495),
        h = i(298),
        p = i(5184),
        u = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "getHotspot",
                value: function (e) {
                  var t = e.header,
                    i = e.footer,
                    n = e.outer_rect,
                    o = p.a.getLayoutCorner(e),
                    a = o.left_top_corner,
                    s = o.right_top_corner,
                    l = o.left_bottom_corner,
                    c = o.right_bottom_corner,
                    d = t && t.rect ? Math.max(t.rect.bottom, a.y) : a.y,
                    h = r.default.initByRawRect({
                      left: a.x,
                      right: s.x,
                      top: 0,
                      bottom: d,
                    }),
                    u = i && i.rect ? Math.min(i.rect.top, l.y) : l.y;
                  return {
                    header_hotspot: h,
                    footer_hotspot: r.default.initByRawRect({
                      left: l.x,
                      right: c.x,
                      top: u,
                      bottom: n.height,
                    }),
                  };
                },
              },
              {
                key: "getAbsoluteHotspot",
                value: function (t) {
                  var i = e.getHotspot(t),
                    n = i.header_hotspot,
                    o = i.footer_hotspot,
                    a = t.outer_rect.origin;
                  return {
                    header_absl_hotspot: r.default.addDeepOffset(n, a),
                    footer_absl_hotspot: r.default.addDeepOffset(o, a),
                  };
                },
              },
            ]),
            e
          );
        })(),
        f = i(6198),
        g = i(1194),
        v = i(315),
        y = i(1955),
        _ = i(4969),
        P = i.n(_),
        T = (function () {
          function e() {
            o()(this, e);
          }
          return (
            s()(e, null, [
              {
                key: "hitReadModeHeaderFooter",
                value: function (t, i, n, o, a) {
                  var s = e.hit(i, n);
                  return e.fireHit(s, a), s;
                },
              },
              {
                key: "fireHit",
                value: function (e, t) {
                  var i = e.where,
                    n = e.bound,
                    o = t && t.event && "mousemove" === t.event.type;
                  if (!window.APP.isReadOnly() && o) {
                    var a = i !== f.a.None,
                      s = i === f.a.Hit_On_Header,
                      r = t.event,
                      d = {
                        pos: { x: r.clientX, y: r.clientY },
                        bound: n,
                        isShow: a,
                        isHeader: s,
                      };
                    l.default.dispatchEvent(c.a.HEADER_FOOTER.SHOW_HIT_TIP, {
                      affair: "showHitTip",
                      params: d,
                    });
                  }
                },
              },
              {
                key: "hit",
                value: function (e, t) {
                  var i = {
                      where: f.a.None,
                      pos: e,
                      bound: { x: t.view.width, y: t.view.height },
                      layout: t,
                    },
                    n = u.getAbsoluteHotspot(t),
                    o = n.header_absl_hotspot,
                    a = n.footer_absl_hotspot;
                  if (r.default.pointInRect(e, o)) i.where = f.a.Hit_On_Header;
                  else if (r.default.pointInRect(e, a))
                    i.where = f.a.Hit_On_Footer;
                  else if (t.getTextFrameInHeaderFooter)
                    for (
                      var s = t.getTextFrameInHeaderFooter(),
                        l = t.header && t.header.range,
                        c = t.footer && t.footer.range,
                        d = s.length - 1;
                      d >= 0;
                      --d
                    ) {
                      var h = s[d],
                        p = r.default.addDeepOffset(
                          h.rect,
                          t.outer_rect.origin
                        );
                      if (r.default.pointInRect(e, p)) {
                        var g = h.snippetPack.range;
                        if (l && g.pos >= l.pos && g.pos < l.pos + l.len) {
                          i.where = f.a.Hit_On_Header;
                          break;
                        }
                        if (c && g.pos >= c.pos && g.pos < c.pos + c.len) {
                          i.where = f.a.Hit_On_Footer;
                          break;
                        }
                      }
                    }
                  return i;
                },
              },
              {
                key: "hasTextFrame",
                value: function (e) {
                  return (
                    e.layers &&
                    e.layers.textframes &&
                    e.layers.textframes.length > 0
                  );
                },
              },
              {
                key: "enterTextFrameContext",
                value: function (e, t) {
                  for (var i = e.length - 1; i >= 0; --i)
                    e[i].isCoorSystem && t.enter(e[i]);
                },
              },
              {
                key: "exitTextFrameContext",
                value: function (e, t) {
                  for (var i = e.length - 1; i >= 0; --i)
                    e[i].isCoorSystem && t.exit();
                },
              },
              {
                key: "hitInTextFrame",
                value: function (t, i, n, o, a) {
                  var s = n.outer_rect,
                    l = { x: i.x - s.left, y: i.y - s.top },
                    c = Number.MAX_SAFE_INTEGER,
                    p = !1;
                  (void 0 !== n.header &&
                    (c = r.default.distanceFromPointToRect(l, n.header.rect)),
                  void 0 !== n.footer) &&
                    r.default.distanceFromPointToRect(l, n.footer.rect) < c &&
                    (p = !0);
                  if (c === Number.MAX_SAFE_INTEGER) return !1;
                  for (
                    var u = n.getTextFrameInHeaderFooter(), f = u.length - 1;
                    f >= 0;
                    --f
                  ) {
                    for (
                      var _ = function (e) {
                          return e.parent
                            ? e.parent
                            : e.isScene()
                            ? e.upper
                            : null;
                        },
                        P = _(u[f]),
                        T = u[f].rect,
                        E = [],
                        S = { x: 0, y: 0 };
                      P.layoutType != v.DOCLayoutType.LayoutPage;

                    )
                      E.push(P),
                        (S.x += P.rect.left),
                        (S.y += P.rect.top),
                        (P = _(P));
                    if (
                      l.x >= T.left + S.x - y.TABLE_HOTSPOT_UNIT.MARGIN &&
                      l.x <= T.right + S.x &&
                      l.y >= T.top + S.y &&
                      l.y <= T.bottom + S.y
                    ) {
                      var x = { x: l.x - T.left - S.x, y: l.y - T.top - S.y },
                        b = u[f],
                        C = b.snippetPack,
                        L = void 0;
                      if (
                        C &&
                        (e.enterTextFrameContext(E, a),
                        a.enter(b),
                        (L = d.a.hit(t, x, C, o, a)),
                        a.exit(),
                        e.exitTextFrameContext(E, a),
                        o.type || (o.type = g.HIT_RESULT_TYPES.TEXTFRAME),
                        L)
                      )
                        return (
                          (o.isInFooter = p),
                          (o.subDocType = h.MainText),
                          (o.layoutPos.x += T.left + S.x),
                          (o.layoutPos.y += T.top + S.y),
                          L
                        );
                    }
                  }
                  return !1;
                },
              },
              {
                key: "hasTextbox",
                value: function (e, t) {
                  var i = e.getTextboxInHeaderFooter();
                  if (i && i.length > 0) return !0;
                  var n = t.selection.selShapes,
                    o = [];
                  return (
                    n &&
                      n.forEach(function (e) {
                        var t = e.topShape;
                        t.isGroup &&
                          (function e(t) {
                            t.childShapes.forEach(function (t) {
                              t.isGroup ? e(t) : t.has_textbox && o.push(t);
                            });
                          })(t);
                      }),
                    o.length
                  );
                },
              },
              {
                key: "hitEditModeHeaderFooter",
                value: function (t, i, n, o, a) {
                  var s = void 0;
                  e.hasTextFrame(n) && (s = e.hitInTextFrame(t, i, n, o, a));
                  var l =
                    void 0 === a.limitInSubdocType ||
                    a.limitInSubdocType === h.TextboxInHF;
                  if (
                    (s || (l && (s = P.a.hitShapes(t, i, n, o, a, !0, !1))), s)
                  )
                    return s;
                  var c = n.outer_rect,
                    p = { x: i.x - c.left, y: i.y - c.top },
                    u = Number.MAX_SAFE_INTEGER,
                    f = !1;
                  if (
                    (void 0 !== n.header &&
                      (u = r.default.distanceFromPointToRect(p, n.header.rect)),
                    void 0 !== n.footer &&
                      r.default.distanceFromPointToRect(p, n.footer.rect) < u &&
                      (f = !0),
                    u === Number.MAX_SAFE_INTEGER)
                  )
                    return !1;
                  var g = f ? n.footer : n.header,
                    v = d.a.hit(t, p, g, o, a);
                  if (v) {
                    if (
                      ((o.isInFooter = f),
                      (o.subDocType = h.HeaderFooter),
                      o.isFuzzyHit && l)
                    ) {
                      var y = Object.assign({}, o);
                      (y.layoutPos = Object.assign({}, o.layoutPos)),
                        (s = P.a.hitShapes(t, i, n, o, a, !0, !0)),
                        v && Object.assign(o, y);
                    }
                    return !0;
                  }
                  return !1;
                },
              },
            ]),
            e
          );
        })();
      t.a = T;
    },
    6800: function (e, t, i) {
      "use strict";
      Object.defineProperty(t, "__esModule", { value: !0 });
      var n = i(21),
        o = i(1194),
        a = n.__importDefault(i(530)),
        s = n.__importDefault(i(345)),
        r = n.__importStar(i(1092)),
        l = (function () {
          function e() {}
          return (
            (e.hitEmbed = function (e, t, i) {
              var n = t.line,
                r = t.glyphGroupInfo,
                l = t.innerPos,
                c = t.shapeForMath,
                d = r.shape || c,
                h = d.id,
                p = d.isLoaded,
                u = d.shape_tree_type,
                f = d.viewPage,
                g = d.textpage,
                v = d.rect,
                y = d.isSeparatorLine,
                _ = f.rect,
                P = f._drawingOffset,
                T = a.default.transvertPositionFromNode2Target(g, f),
                E = r.beginOffset + n.range.pos,
                S = s.default.initByRawRect(v),
                x = s.default.initByOriginAndSize(
                  { x: _.left + S.left + T.x - P.x, y: _.top + S.top + T.y },
                  { width: S.width, height: S.height }
                );
              if (
                (y && (S.offset(-8, -10), S.addSize({ width: 16, height: 20 })),
                l.x >= S.left &&
                  l.x <= S.right &&
                  l.y >= S.top &&
                  l.y <= S.bottom)
              ) {
                var b = e.shapeManager.getSourceUrl(u, h),
                  C = e.shapeManager.shapeMap.getSha1(u, h);
                return (
                  (t.type = o.HIT_RESULT_TYPES.SHAPE),
                  (t.shapeInfo = {
                    id: h,
                    gcp: E,
                    src: b,
                    sha1: C,
                    isLoaded: p,
                    shapeTreeType: u,
                    rect: x,
                    shapeData: d.anchor.shapeData,
                    shape: d,
                    isHitOnShape: !0,
                    isEmbedding: !0,
                  }),
                  (t.isWebshape = d && d.isWebshape),
                  (t.webshapeUrl = d && d.webshapeUrl),
                  !0
                );
              }
              return !1;
            }),
            (e.hitDrawing = function (e, t, i, n) {
              var a = i.view,
                l =
                  i && i.layers && i.layers.getShapeCards
                    ? i.layers.getShapeCards()
                    : [];
              if (!(l.length <= 0)) {
                var c = e.shapeManager._shapeRenderInfo;
                return l.some(function (l) {
                  var d = l.id;
                  if (!c[d]) return !1;
                  var h = c[d],
                    p = h.rect,
                    u = h.isLoaded,
                    f = h.sha1,
                    g = h.coor,
                    v = i.rect.left + g.x + a._viewOffset.x,
                    y = i.rect.top + g.y + a._viewOffset.y,
                    _ = s.default.initByOriginAndSize(
                      { x: p.left + v, y: p.top + y },
                      { width: p.width, height: p.height }
                    );
                  if (
                    t.x >= p.left &&
                    t.x <= p.right &&
                    t.y >= p.top &&
                    t.y <= p.bottom
                  ) {
                    var P = l.anchor,
                      T = P.pos,
                      E = P.shapeData,
                      S = e.shapeManager.getSourceUrl(l.shape_tree_type, d);
                    return (
                      (n.type = o.HIT_RESULT_TYPES.SHAPE),
                      (n.shapeInfo = {
                        gcp: T,
                        id: d,
                        src: S,
                        shape: l,
                        isLoaded: u,
                        sha1: f,
                        shapeData: E,
                        shapeTreeType: r.WPS_SHAPETREE_NONINLINE,
                        rect: _,
                        isHitOnShape: !0,
                        isEmbedding: !1,
                      }),
                      (n.isWebshape = l && l.isWebshape),
                      (n.webshapeUrl = l && l.webshapeUrl),
                      !0
                    );
                  }
                  return !1;
                });
              }
            }),
            e
          );
        })();
      t.default = l;
    },
  },
]);
